The asteroids demo contains this code to keep the asteroids and ship in the view.
[code]int w = view.width/2 + width;
int h = view.height/2 + height;
if(x > w) x = -w;
if( y > h) y = -h;
if(x < -w) x = w;
if(y < -h) y = h; [code]
This works fine, but why does it make the actors stay on the 0 axis of the game.
If you have your view in another position other than at 0, the actors will still wrap around 0.
How can I change it to make it wrap around the view regardless of the position of the view?[/code]