I’m quite new to Python, and i decided to make an FPS.
This is the code I use:
import GameLogic as gl
import Rasterizer as r
cont = gl.getCurrentController()
obj = cont.owner
parent = obj.parent
mouse = cont.sensors[‘Mouse’]
winh = r.getWindowHeight()
winw = r.getWindowWidth()
hwinh = winh//2
hwinw = winw//2
print(winh,winw,hwinh,hwinw)
sens = 0.001
x, y = mouse.position
x = (hwinw - x)*sens
y = (hwinh - y)*sens
obj.applyRotation([y,0.0,0.0], True)
parent.applyRotation([0.0,0.0,x], False)
r.setMousePosition(hwinw,hwinh)
I want to implement a capping angle. How would I do so?
Thanks in advance!