code question

OK, previously I had only used python as a calculator with loops and I have never done anything with panda3d before and I know almost nothing :smiley:

So, in the Roaming Ralph example I added these two lines of code:
self.accept(“arrow_down”, self.setKey, [“backward”,1])
self.accept(“arrow_down-up”, self.setKey, [“backward”,0])

And nothing different happened when I ran it so I was wondering what else I have to do to get it to work?

Edit: I know that I could probably just go forward -1 to get it to work but I looking to learn something, not functionality :smiley:

That line makes the setKey function just store in the dict object that the “backward” key is pressed. It doesn’t do anything yet, somewhere else in the code you see that it actually checks the dict whether the key was pressed and updates teh position based on that.
So, in order to make this work, you need to add some code that actually does something with that “backward” value.