template: global, more xlog

This commit is contained in:
Pascal Engélibert 2024-02-25 23:03:43 +01:00
parent ac045c3e0e
commit 6498472d7a

View file

@ -41,7 +41,7 @@ class Player(Obj):
# Afficher le texte d'information
def print_debug(self, lines):
lines.append("Player {}".format(self.oid))
lines.append("Player {} pos=({}, {}) speed=({}, {})".format(self.oid, self.pos[0], self.pos[1], self.speed[0], self.speed[1]))
screen = pygame.display.set_mode(size) # définir la taille de la fenêtre
clock = pygame.time.Clock()
@ -54,6 +54,7 @@ removable = [] # identifiants des objets à supprimer
# Supprimer les objets à supprimer
def remove_objects():
global removable, objects, players
for oid in removable:
if oid in objects:
objects.pop(oid)