game: online: recoded but collision not work

This commit is contained in:
2024-05-14 03:28:05 +02:00
parent 18bc8a0028
commit 7a0ff15cec
16 changed files with 518 additions and 653 deletions

View File

@ -27,14 +27,14 @@ class PongPlayer(APlayer):
self.rail: Segment = rail
self.is_eliminated: bool = False
self.game: PongGame
def eliminate(self):
self.disconnect(1000)
self.is_eliminated = True
self.game.update_player(self)
def receive(self, data: dict):
detail: str = data.get("detail")
@ -108,7 +108,7 @@ class PongPlayer(APlayer):
def add_goal(self):
timestamp = self.game.model.add_goal(self.user_id)
timestamp = self.game.model.add_goal(self.user)
self.score.append(timestamp)
@ -122,6 +122,8 @@ class PongPlayer(APlayer):
"position": self.position.to_dict(),
"score": self.score,
"isEliminated": self.is_eliminated,
"rail": self.rail.to_dict(),
"isConnected": self.is_connected(),