joystick.py not working
Posted: Fri Apr 12, 2013 8:23 pm
my code:
the error:
the line that it's pointing to:
I can't think of any way I could have screwed this up, and it really seems to be a problem with renpygame. I managed to get it working but simply deleting the __init__() function for Joystick, but that also stops me from using multiple joysticks in my game.
Code: Select all
joysticks = []
for j in range(pygame.joystick.get_count()):
joysticks.append(pygame.joystick.Joystick())
joysticks[j].init()Code: Select all
Full traceback:
File "C:\vns\renpy-6.13.12\renpy\execution.py", line 265, in run
File "C:\vns\renpy-6.13.12\renpy\ast.py", line 632, in execute
File "C:\vns\renpy-6.13.12\renpy\python.py", line 972, in py_exec_bytecode
File "game/script.rpy", line 12, in <module>
File "game/tennis.rpy", line 709, in tennis
File "C:\vns\projects\sup tennis\renpygame\joystick.py", line 27, in __init__
NameError: global name 'pygame' is not definedCode: Select all
self.joystick = pygame.joystick.Joystick(id)