From cf91122a57d3c5bc98ef334980322205eedf48a9 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 30 Nov 2024 22:59:33 -0500 Subject: [PATCH] Building some sweep tag I think! --- sweeptag/requirements.txt | 2 ++ sweeptag/sweeptag.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 sweeptag/requirements.txt create mode 100644 sweeptag/sweeptag.py diff --git a/sweeptag/requirements.txt b/sweeptag/requirements.txt new file mode 100644 index 0000000..d32db17 --- /dev/null +++ b/sweeptag/requirements.txt @@ -0,0 +1,2 @@ +ipython +pygame-ce diff --git a/sweeptag/sweeptag.py b/sweeptag/sweeptag.py new file mode 100644 index 0000000..1be59a8 --- /dev/null +++ b/sweeptag/sweeptag.py @@ -0,0 +1,33 @@ +import pygame + + +def main(): + pygame.init() + + screen = pygame.display.set_mode((640, 480)) + + running = True + font = pygame.Font(None, 80) + title_text = "Sweeptag" + #title_size = font.size(title_text) + title_rendered = font.render(title_text, False, (255, 255, 255), (0, 0, 0)) + + while running: + for event in pygame.event.get(): + if event.type == pygame.QUIT or ( + event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE + ): + running = False + + else: + print(f"EVENT: {event}") + + screen.fill((250, 150, 0)) + screen.blit(title_rendered, (20, 20)) + pygame.display.flip() + + pygame.quit() + + +if __name__ == "__main__": + main()