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.
In your wonderful program each time the frog dies the counter adds two points. I've looked throughout the code but have been unable to find how to edit that feature so the counter only adds two points each time the frog dies.
Thanks for any help on this problem.
2010/7/15
2015/11/23