FPS Help

Blitz3D Forums/Blitz3D Programming/FPS Help

cash(Posted 2004) [#1]
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


electronin(Posted 2004) [#2]
This might work:
xs=MouseXSpeed()
ys=MouseYSpeed()
MoveMouse 400,300
If x>360 Then x=0
If x<0 Then x=360
If y<0 Then y=360
If y>360 Then y=0
RotateEntity man,y,-x,0

Hope that helps!