The way you're using button is fine, but I think that the statement is outside of your game loop. Move the line 73 to the while block(Line 77) and then run the program. Also, try to avoid using goto. There are other statements that are more clear than goto(for-while-def-repeat).