Go to advanced search

by megazoic
Tue Jul 23, 2013 5:49 pm
Forum: Python
Topic: replay game pygame and raspberry snake
Replies: 9
Views: 2047

Re: replay game pygame and raspberry snake

Another note, I just noticed that the pygame.event may still retain a keypress from the previous game and this would trigger the pygame.guit() immediately when gameOver() is called. This happens when you press and hold a key past the call to gameOver(). An easy fix is to clear the event queue by cal...
by megazoic
Tue Jul 23, 2013 5:37 pm
Forum: Python
Topic: replay game pygame and raspberry snake
Replies: 9
Views: 2047

Re: replay game pygame and raspberry snake

I am not a Python programmer and I have reformatted my pi's SD card for a different purpose so it will take a bit of time to get to the original configuration. I just tested the code I posted on my Mac and it works fine. I'm not sure about the extra code that you've added but noticed that you didn't...
by megazoic
Mon Jul 22, 2013 9:36 pm
Forum: Python
Topic: replay game pygame and raspberry snake
Replies: 9
Views: 2047

Re: replay game pygame and raspberry snake

Working with some high school kids at a summer 'funshop' in the US, we came up with this solution based on the above recommendations by previous replies to this question. It just involves adding to the gameOver() function. def gameOver(): global snakePosition, snakeSegments, raspberryPosition, raspb...

Go to advanced search