|
|
@ -65,13 +65,13 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
//der per Konstruktor die Daten der Colorklasse übertragen werden, dannach wird die Map die aktive Welt
|
|
|
|
//der per Konstruktor die Daten der Colorklasse übertragen werden, dannach wird die Map die aktive Welt
|
|
|
|
public void buttonClicked (Button b)
|
|
|
|
public void buttonClicked (Button b)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if ( b == schwarz && possw == true)
|
|
|
|
if ( b == schwarz && possw == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
color[x] = sw;
|
|
|
|
color[x] = sw;
|
|
|
|
pn[x]="Schwarz";
|
|
|
|
pn[x]="Schwarz";
|
|
|
|
x+=1;
|
|
|
|
x+=1;
|
|
|
|
possw = false;
|
|
|
|
possw = false;
|
|
|
|
|
|
|
|
System.out.println("HI");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (b == blau && posbl == true)
|
|
|
|
if (b == blau && posbl == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -79,6 +79,7 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
pn[x] = "Blau";
|
|
|
|
pn[x] = "Blau";
|
|
|
|
x+=1;
|
|
|
|
x+=1;
|
|
|
|
posbl = false;
|
|
|
|
posbl = false;
|
|
|
|
|
|
|
|
System.out.println("HI");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (b == grün && posgr == true )
|
|
|
|
if (b == grün && posgr == true )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -86,6 +87,7 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
pn[x]="Grün";
|
|
|
|
pn[x]="Grün";
|
|
|
|
x+=1;
|
|
|
|
x+=1;
|
|
|
|
posgr = false;
|
|
|
|
posgr = false;
|
|
|
|
|
|
|
|
System.out.println("HI");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( b == rot && posrt == true)
|
|
|
|
if ( b == rot && posrt == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -93,6 +95,7 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
pn[x]="Rot";
|
|
|
|
pn[x]="Rot";
|
|
|
|
x+=1;
|
|
|
|
x+=1;
|
|
|
|
posrt = false;
|
|
|
|
posrt = false;
|
|
|
|
|
|
|
|
System.out.println("HI");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( b == gelb && posgb == true)
|
|
|
|
if ( b == gelb && posgb == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -100,6 +103,7 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
pn[x]="Gelb";
|
|
|
|
pn[x]="Gelb";
|
|
|
|
x+=1;
|
|
|
|
x+=1;
|
|
|
|
posgb = false;
|
|
|
|
posgb = false;
|
|
|
|
|
|
|
|
System.out.println("HI");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( b == lila && posli == true)
|
|
|
|
if ( b == lila && posli == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -107,6 +111,7 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
pn[x]="Lila";
|
|
|
|
pn[x]="Lila";
|
|
|
|
x+=1;
|
|
|
|
x+=1;
|
|
|
|
posli = false;
|
|
|
|
posli = false;
|
|
|
|
|
|
|
|
System.out.println("HI");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( b == weiter && x >=2 )
|
|
|
|
if ( b == weiter && x >=2 )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -116,10 +121,16 @@ public class Colours extends World implements ButtonEvent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
newpn[i] = pn[i];
|
|
|
|
newpn[i] = pn[i];
|
|
|
|
newcolor[i] = color[i];
|
|
|
|
newcolor[i] = color[i];
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
World m = new Map(newcolor,x,newpn);
|
|
|
|
World m = new Map(newcolor,x,newpn);
|
|
|
|
Greenfoot.setWorld(m);
|
|
|
|
Greenfoot.setWorld(m);
|
|
|
|
}
|
|
|
|
System.out.println("HIFertig");
|
|
|
|
|
|
|
|
System.out.println(x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|