Colours Buttons deaktivieren

master
Zocker1999NET 10 years ago
parent 26d255911f
commit 68828cc7cc

@ -96,53 +96,43 @@ 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 (x < 5) {
{ if (b == schwarz && possw == true) {
color[x] = sw; color[x] = sw;
pn[x]=getName(x,"Schwarz"); pn[x]=getName(x,"Schwarz");
if(pn[x].length() > 0) { if(pn[x].length() > 0) {
x+=1; x+=1;
possw = false; possw = false;
} }
} } else if (b == blau && posbl == true) {
if (b == blau && posbl == true)
{
color[x] = bl; color[x] = bl;
pn[x]=getName(x,"Blau"); pn[x]=getName(x,"Blau");
if(pn[x].length() > 0) { if(pn[x].length() > 0) {
x+=1; x+=1;
posbl = false; posbl = false;
} }
} } else if (b == grün && posgr == true ) {
if (b == grün && posgr == true )
{
color[x] = gr; color[x] = gr;
pn[x]=getName(x,"Grün"); pn[x]=getName(x,"Grün");
if(pn[x].length() > 0) { if(pn[x].length() > 0) {
x+=1; x+=1;
posgr = false; posgr = false;
} }
} } else if (b == rot && posrt == true) {
if ( b == rot && posrt == true)
{
color[x] = rt; color[x] = rt;
pn[x]=getName(x,"Rot"); pn[x]=getName(x,"Rot");
if(pn[x].length() > 0) { if(pn[x].length() > 0) {
x+=1; x+=1;
posrt = false; posrt = false;
} }
} } else if (b == gelb && posgb == true) {
if ( b == gelb && posgb == true)
{
color [x] = gb; color [x] = gb;
pn[x]=getName(x,"Gelb"); pn[x]=getName(x,"Gelb");
if(pn[x].length() > 0) { if(pn[x].length() > 0) {
x+=1; x+=1;
posgb = false; posgb = false;
} }
} } else if (b == lila && posli == true) {
if ( b == lila && posli == true)
{
color [x] = li; color [x] = li;
pn[x]=getName(x,"Lila"); pn[x]=getName(x,"Lila");
if(pn[x].length() > 0) { if(pn[x].length() > 0) {
@ -150,6 +140,7 @@ public class Colours extends World implements ButtonEvent
posli = false; posli = false;
} }
} }
}
if(b == remove && x > 0) { if(b == remove && x > 0) {
x -= 1; x -= 1;
switch(color[x]) { switch(color[x]) {

Loading…
Cancel
Save