From 294d29c3eaea3f3db1c2134b052ee471c2bf8851 Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Fri, 20 Sep 2024 19:21:36 +0200 Subject: initial push to GitHub --- main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 2a2328d..8b94acb 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import pygame +import sys from constants import * from circleshape import * from player import * @@ -32,19 +33,25 @@ def main(): for event in pygame.event.get(): if event.type == pygame.QUIT or pygame.key.get_pressed()[pygame.K_q]: return + screen.fill("black") for obj in updatable: obj.update(dt) + for asteroid in asteroids: + for bullet in shots: if bullet.collision_check(asteroid): bullet.kill() - asteroid.kill() + asteroid.split() + if asteroid.collision_check(player): print("Game over!") - return + sys.exit() + for obj in drawable: obj.draw(screen) + pygame.display.flip() dt = clock.tick(60) / 1000 -- cgit v1.2.3