Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Personnage:
- """Classe représentant un labyrinthe."""
- def __init__(self):
- self.x = 0
- self.y = 0
- self.direction = "d"
- def deplacer(self,direction): # d = droit / g = gauche / b = bas / h = haut
- self.direction = direction
- if (direction == "d" and self.x!=15 and (labyrinthe.structure[self.x+1][self.y] == "" or labyrinthe.structure[self.x+1][self.y]== "" )): #Verifie si la case suivante n'est pas en dehors et que ce n'est pas un mur,
- self.x +=1
- if (direction == "g" and self.x!=0):
- self.x -= 1
- if (direction == "b" and self.y!=15):
- self.y += 1
- if (direction == "h" and self.y!=0):
- self.y -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement