We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm not all that familiar with Python Mode in Processing, and have been trying to convert a simple game from Pygame to Processing.
But it appears I can't get from the Play Game screen to actual gameplay - it just crashes and gives me the error "Global name "self" is not defined" in the mouseClicked() function, but it is, isn't it? Either way, I'm sure this is riddled with errors, and can't seem to make it work properly, even though the Pygame version works fine. I know it's a longshot, but can anyone help or offer some advice?
Thanks!
Answers
I know very little Python Mode (Jython). But I'll try to give some advises:
class
FlappyBird, right?class
in order to access them all.game = FlappyBird()
statement @ line #87 instantiates a FlappyBird and assigns that reference to global variable game.An extra advice:
class
FlappyBird.__init__
constructor.Thanks so much! Still working on it, but this was definitely helpful. I don't get immediate errors anymore, but once I press "Play Game" the screen remains black, which probably means the game function is not executing and/or there's an error in the logic.