While trying to write a new program for astronauts, spaceships and rocks to fly around in my world, I cannot get my spaceship to turn. Here is the code I am using
/**
* Act - do whatever the astronaut wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void move()
{
move(10);
if (isAtEdge())
{turn (45);
}
if (Greenfoot.getRandomNumber(100) < 10)
{turn(Greenfoot.getRandomNumber(90)-45);
}
if (Greenfoot.isKeyDown("space") )
{turn(-45);
}
if (Greenfoot.isKeyDown("up") )
{turn(45);
}
}
}