Add files via upload

neue colorklasse
master
JulienRo 10 years ago committed by GitHub
parent ceb3dc9348
commit cbb92e39d2

@ -16,6 +16,7 @@ public class Colors extends World implements ButtonEvent
Button gelb = new Button ("Gelb", 16, this); Button gelb = new Button ("Gelb", 16, this);
Button weiter = new Button ("Weiter", 16, this); Button weiter = new Button ("Weiter", 16, this);
int [] color = new int [6]; int [] color = new int [6];
String [] pn = new String [6];
int x; int x;
boolean possw = true; boolean possw = true;
boolean posbl = true; boolean posbl = true;
@ -58,42 +59,48 @@ public class Colors extends World implements ButtonEvent
if ( b == schwarz && possw == true) if ( b == schwarz && possw == true)
{ {
color [x] = sw; color [x] = sw;
pn[x]="Schwarz";
x+=1; x+=1;
possw = false; possw = false;
} }
if (b == blau && posbl == true) if (b == blau && posbl == true)
{ {
color[x] = bl; color[x] = bl;
pn[x] = "Blau";
x+=1; x+=1;
posbl = false; posbl = false;
} }
if (b == grün && posgr == true ) if (b == grün && posgr == true )
{ {
color[x] = gr; color[x] = gr;
pn[x]="Grün";
x+=1; x+=1;
posgr = false; posgr = false;
} }
if ( b == rot && posrt == true) if ( b == rot && posrt == true)
{ {
color[x] = rt; color[x] = rt;
pn[x]="Rot";
x+=1; x+=1;
posrt = false; posrt = false;
} }
if ( b == gelb && posgb == true) if ( b == gelb && posgb == true)
{ {
color [x] = gb; color [x] = gb;
pn[x]="Gelb";
x+=1; x+=1;
posgb = false; posgb = false;
} }
if ( b == lila && posli == true) if ( b == lila && posli == true)
{ {
color [x] = li; color [x] = li;
pn[x]="Lila";
x+=1; x+=1;
posli = false; posli = false;
} }
if ( b == weiter && x >1) if ( b == weiter && x >1)
{ {
Map m = new Map(color, x); Map m = new Map(color, x,pn);
addObject(m); addObject(m);
setWorld(Map,m); setWorld(Map,m);
} }

Loading…
Cancel
Save