30.09.2026 Stundenende
This commit is contained in:
+20
-39
@@ -1,6 +1,5 @@
|
||||
import copy
|
||||
import pygame
|
||||
import time
|
||||
import random
|
||||
|
||||
|
||||
@@ -9,6 +8,12 @@ class MeinSpiel:
|
||||
"Bilder/Spielfiguren/spielfigur-gelb.png",
|
||||
"Bilder/Spielfiguren/spielfigur-gruen.png",
|
||||
"Bilder/Spielfiguren/spielfigur-blau.png"]
|
||||
wuerfel = ["Bilder/wurfel-1.png",
|
||||
"Bilder/wuerfel-2.png",
|
||||
"Bilder/wuerfel-3.png",
|
||||
"Bilder/wurfel-4.png",
|
||||
"Bilder/wurfel-5.png",
|
||||
"Bilder/wuerfel-6.png"]
|
||||
hintergrundbilder = []
|
||||
spielfeld = []
|
||||
spielfiguren = []
|
||||
@@ -16,6 +21,8 @@ class MeinSpiel:
|
||||
figur_entfernt = False
|
||||
am_zug = 0
|
||||
bewegungsrichtung = "rechts"
|
||||
zufallswert = int()
|
||||
wuerfelBildAnzeigen = False
|
||||
|
||||
def __init__(self, felderX, felderY):
|
||||
for x in range(felderX):
|
||||
@@ -35,17 +42,20 @@ class MeinSpiel:
|
||||
|
||||
def tasteGedrueckt(self, taste):
|
||||
if taste == pygame.K_SPACE:
|
||||
zufallswert = random.randint(1, 6)
|
||||
self.zufallswert = random.randint(1, 6)
|
||||
|
||||
for i in range(zufallswert):
|
||||
print(f"{i}: {zufallswert}")
|
||||
self.wuerfelBildAnzeigen = True
|
||||
|
||||
for i in range(self.zufallswert):
|
||||
self.figur_entfernt = False
|
||||
print(f"[{i}] Figur {self.am_zug} geht {self.zufallswert}")
|
||||
for x in range(len(self.spielfiguren)):
|
||||
for y in range(len(self.spielfiguren[x])):
|
||||
try:
|
||||
if len(self.spielfiguren[x][y]) > 0 and self.figur_entfernt == False:
|
||||
if self.bewegungsrichtung == "rechts" and x == 6: self.bewegungsrichtung = "unten"
|
||||
|
||||
print(f"Figuren auf Feld ({x}|{y}): {self.spielfiguren[x][y]}")
|
||||
# print(f"Figuren auf Feld ({x}|{y}): {self.spielfiguren[x][y]}")
|
||||
self.spielfiguren[x][y].pop(self.spielfiguren[x][y].index(self.am_zug))
|
||||
self.figur_entfernt = True
|
||||
|
||||
@@ -66,40 +76,11 @@ class MeinSpiel:
|
||||
|
||||
|
||||
print(self.bewegungsrichtung)
|
||||
|
||||
self.am_zug += 1
|
||||
break
|
||||
else:
|
||||
print(f"keine Figuren auf Feld ({x}|{y}): {self.spielfiguren[x][y]}")
|
||||
# print(f"keine Figuren auf Feld ({x}|{y}): {self.spielfiguren[x][y]}")
|
||||
break
|
||||
except ValueError:
|
||||
print(f"x: {x}, y: {y}")
|
||||
# print(f"x: {x}, y: {y}")
|
||||
break
|
||||
print("____________")
|
||||
|
||||
# if len(self.spielfiguren[x][y]) > 0:
|
||||
# figur = self.spielfiguren[x][y].pop()
|
||||
# print(f"Bewege Figur {figur} von Feld {x}, {y}")
|
||||
# if x < len(self.spielfiguren) - 1:
|
||||
# self.spielfiguren[x + 1][y].append(figur)
|
||||
# print(f"Bewege Figur {figur} auf Feld {x + 1}, {y}")
|
||||
# else:
|
||||
# self.spielfiguren[0][y].append(figur)
|
||||
# print(f"Bewege Figur {figur} auf Feld 0, {y}")
|
||||
|
||||
#if len(self.spielfiguren[x][y]) > 0:
|
||||
# print(self.spielfiguren[x][y])
|
||||
# self.spielfiguren[x][y].pop(self.spielfiguren[x][y].index(1))
|
||||
|
||||
# if len(self.spielfiguren[x][y]) > 0:
|
||||
# # print(str(x) + " | " + str(len(self.spielfiguren) - 1) + " | " + str(self.spielfiguren))
|
||||
# self.spielfiguren[x][y].pop(
|
||||
# self.spielfiguren[x][y].index(-1))
|
||||
# if x < len(self.spielfiguren) - 1:
|
||||
# self.spielfiguren[x + 1][y].append(3)
|
||||
# else:
|
||||
# self.spielfiguren[x - 1][y].append(3)
|
||||
|
||||
|
||||
# def renderText(self, text: str, x: int, y: int, color: tuple):
|
||||
# font = pygame.font.SysFont("David CLM", 74)
|
||||
# textSurface = font.render(text, True, color)
|
||||
# self.spielfeld[x][y] = textSurface # <-- hier ist noch ein Problem
|
||||
self.am_zug += 1
|
||||
|
||||
Reference in New Issue
Block a user