Hello all, I'm new to Greenfoot and one of my games I am doing for a school project isn't working. This following snippet of code is from my actor, however the Greenfoot.isKeyDown isn't working.
public void act()
{
if (Greenfoot.isKeyDown("d"))
{
move(1);
}
if (Greenfoot.isKeyDown("a"))
{
move(-1);
}
GreenfootImage image = getImage();
image.scale(30, 30);
}
I also have another actor which randomly spawns in copies of itself and I'm beginning to think that it might be the problem as my character moves fine without it.
public void act()
{
Greenfoot.delay(50);
getWorld().addObject(new Apple1(), Greenfoot.getRandomNumber(600), 0);
Greenfoot.delay(50);
getWorld().addObject(new Apple1(), Greenfoot.getRandomNumber(600), 225);
}
