From cbb92e39d2f3f60ad74ef044f68ff54baa15bbd8 Mon Sep 17 00:00:00 2001 From: JulienRo Date: Tue, 21 Jun 2016 08:20:22 +0200 Subject: [PATCH] Add files via upload neue colorklasse --- Colors.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Colors.java b/Colors.java index 79d5cc1..aef76cf 100644 --- a/Colors.java +++ b/Colors.java @@ -16,6 +16,7 @@ public class Colors extends World implements ButtonEvent Button gelb = new Button ("Gelb", 16, this); Button weiter = new Button ("Weiter", 16, this); int [] color = new int [6]; + String [] pn = new String [6]; int x; boolean possw = true; boolean posbl = true; @@ -58,42 +59,48 @@ public class Colors extends World implements ButtonEvent if ( b == schwarz && possw == true) { color [x] = sw; + pn[x]="Schwarz"; x+=1; possw = false; } if (b == blau && posbl == true) { color[x] = bl; + pn[x] = "Blau"; x+=1; posbl = false; } if (b == grün && posgr == true ) { color[x] = gr; + pn[x]="Grün"; x+=1; posgr = false; } if ( b == rot && posrt == true) { color[x] = rt; + pn[x]="Rot"; x+=1; posrt = false; } if ( b == gelb && posgb == true) { color [x] = gb; + pn[x]="Gelb"; x+=1; posgb = false; } if ( b == lila && posli == true) { color [x] = li; + pn[x]="Lila"; x+=1; posli = false; } if ( b == weiter && x >1) { - Map m = new Map(color, x); + Map m = new Map(color, x,pn); addObject(m); setWorld(Map,m); }