Initialcommit

This commit is contained in:
2024-07-07 14:41:55 +02:00
commit bf2a04e74a

45
main.py Normal file
View File

@@ -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)