From a90a53411e2c89e9d9abb1d2439d5cafb33442d0 Mon Sep 17 00:00:00 2001 From: IM23a-bachmannj2 Date: Wed, 23 Oct 2024 21:28:25 +0200 Subject: [PATCH] First commit (structure) --- game_manager.py | 0 main.py | 36 ++++++++++++++++++++++++++++++++++++ settings.py | 3 +++ tetrominos.py | 0 4 files changed, 39 insertions(+) create mode 100644 game_manager.py create mode 100644 main.py create mode 100644 settings.py create mode 100644 tetrominos.py diff --git a/game_manager.py b/game_manager.py new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..0062dd2 --- /dev/null +++ b/main.py @@ -0,0 +1,36 @@ +"""importing Important Modules""" + +from settings import width, height +import sys +import pygame +import random + + +def main(): + # Initialize Pygame + pygame.init() + + # Set up the display + screen = pygame.display.set_mode((width, height)) + pygame.display.set_caption("Tetris") + + # Set up the clock for controlling the frame rate + clock = pygame.time.Clock() + + # Main game loop + while True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit() + sys.exit() + + # Update the display + pygame.display.flip() + + # Control the frame rate + clock.tick(60) + + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..91c1e9d --- /dev/null +++ b/settings.py @@ -0,0 +1,3 @@ +# Set global width and height variables +global width, height +width, height = 800, 600 \ No newline at end of file diff --git a/tetrominos.py b/tetrominos.py new file mode 100644 index 0000000..e69de29