Ich weiss nicht mehr weiter. Wie bekomme ich es hin, dass mein Pacman wieder durch die Gänge läuft?
import math
import pygame
pygame.init()
#Konstante
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 128)
CYAN = (0, 255, 255)
WIDTH = 500
HIGHT = 500
blockSize = 1
border_Color = (220, 20, 60)
radius = 10
xPos = 30
yPos = 30
Player1_Color = (0, 255, 255)
Player1_Speed = 3
schrittPause = 50
openMouthRight = [45, 315]
openMouthUp = [135, 45]
openMouthLeft = [225, 135]
openMouthDown = [315, 225]
isOpening = False
pause = False
mouthSize = openMouthRight
mouthSpeed = 10
screen = pygame.display.set_mode((WIDTH, HIGHT))
pacman = pygame.draw.arc(screen, Player1_Color, [xPos, yPos, 2 * radius, 2 * radius], math.radians(mouthSize[0]),
math.radians(mouthSize[1]), radius)
clock = pygame.time.Clock()
activeKey = None
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
def spielfeldLesen():
f = open("spielfeld.txt", "r")
xDim = int(f.readline()) # 15
yDim = int(f.readline()) # 10
mSpielfeld = [[0 for i in range(xDim)] for j in range(yDim)]
# nur zum testen
mSpielfeld [2][1] = 99
for row in range(yDim):
for col in range(xDim):
mSpielfeld[row][col] = int(f.read(1))
f.read(1) # das NL fressen
f.close()
return [xDim, yDim, mSpielfeld]