Original Post
I've been following a certain pyGame Pong tutorial (actually I copy+pasted the source code and have been tweaking some things - although I just started this morning). What I'd like to do now, is if the ball should hit a left-right wall, the game will restart. Later, I will add a counter (although I think I know how to do this). My question, derived in some mutant pseudo-code, is would I perform this action like this:
while HITSIDE = FALSE
continue
else
RESTARTGAME
Or would I not put it in my main game loop? (Here's the source code, minus the ball and bat images: http://rafb.net/p/EadR0167.html) EDIT: To elaborate a bit, would it look something like:
if dx == 0 or 640:
raise SystemExit
With SystemExit to be replaced later on with the game restart?