Questions about First Person Shooter

So, I have few questions…

  1. whenever I want to use, I have to put 0 inside the parameter. Does anyone know why you have to put 0?

  2. This code is from here. (

    def mouseUpdate(self,task):
        md =
        x = md.getX()
        y = md.getY()
            self.node.setH(self.node.getH() -  (x -*0.3)
            self.node.setP(self.node.getP() - (y -*0.3)
        return task.cont

(self.node is just a nodepath that is child to the camera.)

My questions is, I don’t understand this line


Why is this working? I don’t understand why ‘if’ statement is used with…
and why do you put 0?

  1. In some cases, there can be more than one pointer, especially when enabling raw mouse support. 0 always refers to the system mouse pointer.

  2. Well, you put 0 in movePointer because you want to move the aforementioned system pointer.

The reason why there’s an “if” is that movePointer isn’t guaranteed to succeed at moving the pointer. If the mouse is outside the window, or if the window is minimized, the operating system won’t allow Panda to move the pointer. So, if it fails, it returns False. In this case, you usually don’t want to keep spinning the camera around endlessly, so the code decides not to update the camera unless it succeeds in moving the pointer.