From b43a2b32b3a779de604821ead60b4637924af907 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 7 May 2015 21:01:51 +0100 Subject: [PATCH] random crap --- game.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game.py b/game.py index bfbceff..020a8b6 100644 --- a/game.py +++ b/game.py @@ -84,7 +84,6 @@ def play(window): window.fill((0,0,0)) player_group.update() - for event in pygame.event.get(): if event.type == pygame.QUIT: logging.critical("Exiting Game...") @@ -109,17 +108,16 @@ def play(window): temp = Bullet(player) bullet_group.add(temp) - for sprite in bullet_group: if not sprite.at_bound(): sprite.update() if sprite.rect.y < 0 or sprite.rect.y > player.rect.y: bullet_group.remove(sprite) - for bullet in bullet_group: hit_list = pygame.sprite.spritecollide(bullet, target_group, True) for target in hit_list: + if bullet.type == "TARGET": continue target_group.remove(target) bullet_group.remove(bullet) logging.info("Hit Target!") @@ -165,14 +163,17 @@ def play(window): update_score(window, player.score) update_level(window, player.level) + player_group.update() bullet_group.draw(window) target_group.draw(window) player_group.draw(window) pygame.display.update() + target_movement_timeout -= 1 clock.tick(FPS) + if __name__ == "__main__": logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG) initialise(None, None)