game: online: recoded but collision not work
This commit is contained in:
@ -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(),
|
||||
|
Reference in New Issue
Block a user