45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
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)
|
|
|
|
|
|
|