I am trying to make a little game where the monster runs around trying to catch the food, but so far the food is already there and i want it to spawn in at the maximum number of 3 per time and then as the monster eats the food another one spawns i have tried looking thing up on other peoples discussions but nothing they have has wrote have worked yet.
so far i have
Im sorry its not much to go by
Please help me
and thank you for your time
Michael
public void act()
{
moveAround();
}
public void moveAround()
{
move(4);
if (Greenfoot.getRandomNumber(100) < 10)
{
turn(Greenfoot.getRandomNumber(90) - 45);
}
if (getX() <= 5 || getX() >= getWorld().getWidth() - 5)
{
turn(180);
}
if (getY() <= 5 || getY() >= getWorld().getHeight() - 5)
{
turn(180);
}
}

