Hello ! I'm relatively new to Greenfoot and I'm trying to create a big game . For the first level I want to have a battle between Theseus and the Minotaur and I thought of the following combat mechanic : The Minotaur randomly runs through the room and can kill Theseus and there is a chance he gets tired and stops moving and Theseus can kill him (or at least damage him we'll see) .
That's the code I wrote so far the thing is the Minotaur doesn't really ever stop and if I change the settings and make him stop I can't move Theseus. What should I do ?
private int stunTimer;
public void act()
{
// Add your action code here.
Actor tezeu;
if (Greenfoot.getRandomNumber(50)>45)
{ stunTimer = 200000000;
if (stunTimer>0) {stunTimer--;
tezeu = getOneObjectAtOffset(0,0,Tezeu.class);
if (tezeu!=null) Greenfoot.setWorld (new MyWorld());
}}
//while (stunTimer>0) stunTimer--;
else {
move ();
tezeu = getOneObjectAtOffset(0,0,Tezeu.class);
if (tezeu!=null) {
World world;
world = getWorld();
world.removeObject(tezeu);}
}
}
public void move ()
{ move (Greenfoot.getRandomNumber(10)*5);
turn(10-Greenfoot.getRandomNumber(20));
if (isAtEdge()) turn (180);
}


