—
[quote:2nie8l7k]p = ViewportRight/2
q = ViewportBottom/2
(so now p,q is the exact centrepoint of the viewport)
There is a mistake, Viewport gives you the COORDINATES, not the window size. Confusion! Take care, you have to use either WindowHeight/Width for that, or just use Player.X Player.Y, since he is centered! Or (ViewportBottom-ViewportTop)/2 to subtract the coordinates, and get half of the screen size. I hope you understand.
That is, why you have to tell him, which layers coordinates to get by VieportBottom(Player.LayerNumber) or just ViewportBottom(0).
When you work with stuff like that, it is a helpful thing to display those variables on your screen (set Text = ViewportLeft ), to avoid such confusions. Also there you get a good idea, how they relate, and how you can use that to determine the formula.