09.09.26
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import copy
|
||||
import pygame
|
||||
|
||||
class MeinSpiel:
|
||||
bilder = ["Bilder/Grass.jpg","Bilder/Hase.jpg","Bilder/m.webp","Bilder/blue.jpg","Bilder/Mensch.webp"]
|
||||
spielfeld = []
|
||||
|
||||
def __init__(self, felderX, felderY):
|
||||
for x in range(felderX):
|
||||
self.spielfeld.append([])
|
||||
for y in range(felderY):
|
||||
self.spielfeld[x].append(3)
|
||||
|
||||
def anfangsKonfiguration(self):
|
||||
self.spielfeld[6][2] = 2
|
||||
self.spielfeld[3][1] = 4
|
||||
|
||||
|
||||
def tasteGedrueckt(self, taste):
|
||||
if pygame.K_UP == taste:
|
||||
print("UP")
|
||||
self.spielfeld[12][12] = 2
|
||||
if pygame.K_DOWN == taste:
|
||||
print("DOWN")
|
||||
self.spielfeld[12][13] = 2
|
||||
if pygame.K_LEFT == taste:
|
||||
for x in range(len(self.spielfeld)):
|
||||
for y in range(len(self.spielfeld[x])):
|
||||
if self.spielfeld[x][y] == 1:
|
||||
self.spielfeld[x][y-1] = 1
|
||||
self.spielfeld[x][y] = 0
|
||||
|
||||
Reference in New Issue
Block a user