I am a newb but managed to get my Panda moving around after browsing a few hours of the docs
My problem: I want to make a class (Ralph) of type Actor and DirectObj (an Actor that listens to Events). The code is not elegant and I could use a little hint how to do it nicer. Every time I create an instance of Ralph I have to call makeAccept() to initialize the controls. A nicer way would be to do that at the init() but I get lots of errors when trying to overload that function (surely because the way I do it is not proper).
#subquestion: does I really need to inherit from direct.actor.Actor.Actor ?? class Ralph(direct.actor.Actor.Actor, DirectObject.DirectObject): def makeAccept(self): self.accept('arrow_right', self.moveRight) self.accept('arrow_left', self.moveLeft) self.accept('arrow_up', self.moveUp) self.accept('arrow_down', self.moveDown) def moveRight(self): self.setX(self.getX()- 0.2) def moveLeft(self): self.setX(self.getX()+ 0.2) def moveUp(self): self.setY(self.getY()- 0.2) def moveDown(self): self.setY(self.getY()+ 0.2)