From 9e795071dc9aca96e513bf37ac941b0fe4aeccba Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Fri, 20 Sep 2024 16:52:21 +0200 Subject: Initial commit --- .gitignore | 2 ++ constants.py | 7 +++++++ main.py | 15 +++++++++++++++ requirements.txt | 1 + 4 files changed, 25 insertions(+) create mode 100644 .gitignore create mode 100644 constants.py create mode 100644 main.py create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ea05a1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv/ +__pycache__/ \ No newline at end of file diff --git a/constants.py b/constants.py new file mode 100644 index 0000000..6f9d7d2 --- /dev/null +++ b/constants.py @@ -0,0 +1,7 @@ +SCREEN_WIDTH = 1280 +SCREEN_HEIGHT = 720 + +ASTEROID_MIN_RADIUS = 20 +ASTEROID_KINDS = 3 +ASTEROID_SPAWN_RATE = 0.8 # seconds +ASTEROID_MAX_RADIUS = ASTEROID_MIN_RADIUS * ASTEROID_KINDS diff --git a/main.py b/main.py new file mode 100644 index 0000000..e91ba28 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +import pygame +from constants import * + +def main(): + pygame.init() + screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) + while True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + return + screen.fill("black") + pygame.display.flip() + +if __name__ == "__main__": + main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a76295c --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pygame==2.6.0 -- cgit v1.2.3