Quick python help

I was looking at an old game and had a python question. The cursor does not move side to side to the screen borderin compiled game ( look at image) I want the cursor to move where the green arrows are pointing, right now cursor moves to red arrows. I have tried playing with the script below.

import Rasterizer as R
cont = GameLogic.getCurrentController()
own = cont.getOwner()
mPosi = cont.getSensor(“MousePosi”)

Start mouse position at center of game screen

if own.init == 1:
R.setMousePosition(R.getWindowWidth()/2, R.getWindowHeight()/2)
own.init = 0

Move cursor to mouse position

cursorPosi = mPosi.getRaySource()


that uses an old api. theres a chance a lot more is very broken and would require a major overhaul.

import bge


I thought it would be a simple fix, I tried fooling with it but can’t make it work. Maybe someone knows.

mind pointing to the game so i can have a look?

I was fooling with it and it works now. It was the game frame settings for cursor