Hi folks,

Hope everyones well and good! I am currently working on a new game, its quite classic in its nature - harking back to classic coin-munchers such as space invaders, galagga and Atlantis. Anyway, the game involves a ship orbiting a planent in the centre of the screen.

So far I have the basic code in place to make the ship orbit the planet:

///***Ship Movement Setup***///
var radius = 200;
var speed = 2
var xcenter = ship._x;
var ycenter = ship._y;
var degree = 0;
var radian;

function onEnterFrame(){
degree += speed;
radian = (degree/180)*Math.PI;
ship._x = xcenter+Math.cos(radian)*radius;
ship._y = ycenter-Math.sin(radian)*radius;
ship._rotation = ship._x+ship._y
}
///***///***///***///
stop();
what I'd really like is for the rotation of the ship to compensate for its orbit. ie. I'd like the ship to permanently face outward (so it can shoot baddies!)

Can anyone think of a bit of math that could achieve this?

If anyone can help that would be very much appreciated!

thanks