ich bau es mittels objekt klasse auf
Code: Alles auswählen
class Tile(pygame.sprite.Sprite):
def __init__(self,pos,pas):
pygame.sprite.Sprite.__init__(self, self.containers)
self.images = []
self.pas = pas
self.images.append(load_image_alpha('tilea.png', -1))
self.images.append(load_image_alpha('tileb.png', -1))
self.image = self.images[0]
if self.pas == False:
self.image = self.images[1]
self.rect = self.image.get_rect(center = pos)
Spielfeldaufbau wie folgt
Code: Alles auswählen
if LEVEL == 8 and PROGRESS == 8:
player.kill()
pas = True
x = -160
y = -160
for row in range((screen.get_height()*2)/80):
for col in range((screen.get_width()*2)/80):
#pos = []
pos = x,y
Tile(pos,pas)
x += 80
x = 0
y += 80
PROGRESS = 9
pygame.display.flip()
player = Panzer()
ne iddee