Hey brother, in your frog. Instead of all that mumbo, jumbo you had written up replace it with this
**CODE**
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
public class Frog extends Mover
{
public void act()
{
checkKeyPress();
}
public void checkKeyPress()
{
if(Greenfoot.isKeyDown("left"))
{
setLocation(getX() - 5, getY());
}
if(Greenfoot.isKeyDown("right"))
{
setLocation(getX() + 5, getY());
}
if(Greenfoot.isKeyDown("up"))
{
setLocation(getX() , getY() - 5);
}
if(Greenfoot.isKeyDown("down"))
{
setLocation(getX(), getY() + 5);
}
}
}
Way to easy haha. Goodluck.
Recent Comments | Show All
2010/7/15
FROGGER
2010/7/2
Best Change Calculator