From d8ce0f002c09c98ae79c505a4daf8fabb261581d Mon Sep 17 00:00:00 2001 From: kleph Date: Mon, 17 Aug 2009 00:43:59 +0200 Subject: [PATCH] main loop reorganizing --- pyshoot.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pyshoot.py b/pyshoot.py index d1d86b6..70da068 100755 --- a/pyshoot.py +++ b/pyshoot.py @@ -234,21 +234,16 @@ pygame.display.flip() globals.moving_objects.add(player) while not globals.die: - # erase player - #globals.screen.blit(background, player.rect, player.rect) - # draw player - #globals.screen.blit(player.image, player.pos) - + # erase moving objects globals.moving_objects.clear(globals.screen, globals.background) globals.bullets_list.clear(globals.screen, globals.background) - - # erase moving objects + # update game logic globals.moving_objects.update() - rectlist = globals.moving_objects.draw(globals.screen) - - # bullets handling globals.bullets_list.update() + + # drawing + rectlist = globals.moving_objects.draw(globals.screen) rectlist.extend(globals.bullets_list.draw(globals.screen)) pygame.display.update(rectlist)