Edited lock to block all interraction including animation instead of just the movements

This commit is contained in:
Adastram 2024-01-11 10:30:34 +01:00
parent 1f8444bc0b
commit e8343160d4

View file

@ -119,6 +119,8 @@ class Entity:
def move(self, x: float, y: float, map_manager: MapManager):
"""Fait bouger l'entité en tenant compte des collisions."""
if not self.locked: # Si l'entité n'est pas verrouillée on calcul le mouvement
# On vérifie le sens du mouvement pour changer self.direction
if x > 0:
self.direction = 0
@ -133,7 +135,7 @@ class Entity:
y = y/initial_speed*self.max_speed
# On simule le mouvement. Si on ne rencontre pas de collision, on applique le mouvement
if not self.locked: # Si l'entité n'est pas verrouillée on applique le movement
if not self.get_collisions(self.x + x, self.y, map_manager):
self.x += x
else: