Hey i am making a fishing game and the fish in the water is currently going above the water line how do I stop this. Thanks
import greenfoot.*;
/**
* Write a description of class Pelican here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Bonusfish extends Animal
{
/**
* Act - do whatever the Pelican wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move (3);
int num=Greenfoot.getRandomNumber(100);
if(num<10)
{
turn(15);
}
if (atWorldEdge())
{
turn(3);
}
}
}
if (getY() < 200) setLocation(getX(), 200);