Hello,
while programming Deal or no Deal I came up with a little problem.
So in the act method I check, if we are in a specific round and if we are a method is called to show the offer in a text.
Now to my question: The player has to press the "No Deal" button to continue opening cases, is it possible that the button also removes the offertext?
right now this is the code:
Thanks in advance!
public void act()
{
if(((DealWorld) getWorld()).Kofferungeöffnet ==15)
{Angebot = ((DealWorld) getWorld()).Angebot *0.15;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet >11)
{keinBanker();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==11)
{Angebot = ((DealWorld) getWorld()).Angebot *0.22;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet >8 )
{keinBanker();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==8)
{Angebot = ((DealWorld) getWorld()).Angebot *0.37;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet >6)
{keinBanker();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==6)
{Angebot = ((DealWorld) getWorld()).Angebot *0.45;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==5)
{Angebot = ((DealWorld) getWorld()).Angebot *0.54;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==4)
{Angebot = ((DealWorld) getWorld()).Angebot *0.63;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==3)
{Angebot = ((DealWorld) getWorld()).Angebot *0.7;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==2)
{Angebot = ((DealWorld) getWorld()).Angebot *0.9;
Bankerrunde();}
else if(((DealWorld) getWorld()).Kofferungeöffnet ==1)
{Angebot = ((DealWorld) getWorld()).Angebot;
Bankerrunde();}
} void Bankerrunde()
{
double x = Math.round(Angebot);
int i;
i = (int) x;
this.getWorld().showText(i+"€",637,87);
}
void keinBanker()
{
this.getWorld().showText(null,637,87);
}public void act()
{
if(Greenfoot.mouseClicked(this))
{
((DealWorld) getWorld()).Test--;
super.keinBanker();
}
}
