FPS Help

Blitz3D Forums/Blitz3D Programming/FPS Help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The code below allows me to rotate the camera using the mouse. Only problem is it seems to jump when the graphicswidth() is reached and the smooth raoation for an instant is disrupted.

Any ideas how to fix this ?

xs=MouseXSpeed()
ys=MouseYSpeed()
MoveMouse 400,300
x=x+xs
y=y+ys
If x>GraphicsWidth() Then x=x-GraphicsWidth()
If x<0 Then x=x+GraphicsWidth()
If y<0 Then y=y+GraphicsHeight()
If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
RotateEntity man,y,-x,0