I am trying to get the rectangle I drew to move to the right when the right arrow key is pressed. This is the code so far:
public class MenuSelector extends Actor
{
/**
* Act - do whatever the MenuSelector wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
//Creating instance of a new image to change it
GreenfootImage rightBox = new GreenfootImage ("ThisScreenBox.jpg");
public void act()
{
if (Greenfoot.isKeyDown ("right"))
{
setImage(rightBox);
}
}
}
