how can you make a rocket move using the arrow keys
![Twitter](/assets/twitter-4e19209ef84344ee0c433f4c7bad8d49.png)
![Twitter.hover](/assets/twitter.hover-1fb19a5bafc50deace8f88eaec867845.png)
public void act() { if (Greenfoot.isKeyDown("left")) { turn(-5); } if (Greenfoot.isKeyDown("right")) { turn(5); } if (Greenfoot.isKeyDown("up")) { move(5); } if (Greenfoot.isKeyDown("down")) { move(-5); } } private void move(double distance) { double angle = Math.toRadians(getRotation()); setLocation(getX() + (Math.cos(angle) * distance), getY() + (Math.sin(angle) * distance)); }