commit bf2a04e74a6d022480116bdb0b2ccadeef7e07f1 Author: administrator Date: Sun Jul 7 14:41:55 2024 +0200 Initialcommit diff --git a/main.py b/main.py new file mode 100644 index 0000000..27654f9 --- /dev/null +++ b/main.py @@ -0,0 +1,45 @@ +import pygame + + +pygame.init() +MAINSCREEN_SIZE = (1024,768) +MAINSCREEN = pygame.display.set_mode(MAINSCREEN_SIZE) +pygame.display.set_caption("PACMAN") +clock = pygame.time.Clock() + +WEISS = (255,255,255) +SCHWARZ = (0,0,0) +GRUEN = (0,255,0) +ROT = (255,0,0) + +PLAYGROUND = pygame.Surface((1024,728)) + +gamestate = True + + + +while(gamestate==True): + MAINSCREEN.fill(WEISS) + PLAYGROUND.fill(WEISS) + for event in pygame.event.get(): + if (event.type == pygame.QUIT): + print("Programm wird geschlossen!") + gamestate = False + if (event.type == pygame.KEYDOWN): + if (event.key == pygame.K_UP): + print("hoch") + if (event.type == pygame.KEYDOWN): + if (event.key == pygame.K_DOWN): + print("runter") + if (event.type == pygame.KEYDOWN): + if (event.key == pygame.K_LEFT): + print("links") + if (event.type == pygame.KEYDOWN): + if (event.key == pygame.K_RIGHT): + print("rechts") + + pygame.display.flip() + clock.tick(60) + + + \ No newline at end of file