I have a game where an Aligator runs around trying to kill the frogs by shooting lemons. I am unable to move and shoot at the same time, is there any way I can fix this?
// add the constructor
public Aligator()
{
// Sets the rocket as a smaller image.
getImage().scale(120,32);
}if(Greenfoot.isKeyDown("up"))
{
move(5);
int w=getWorld().getWidth();
int h=getWorld().getHeight();
setLocation((getX()+w)%w, ((getY()+h)%h));
}
//Sets our image as a smaller size.
GreenfootImage img = getImage();
img.scale(20,20);
setImage(img);