game: fix
This commit is contained in:
parent
5bb7c99300
commit
7d4c00c2a2
@ -160,7 +160,7 @@ export class PongGame extends AGame
|
||||
else if (data.detail === "update_ball")
|
||||
this._updateBall(data);
|
||||
else if (data.detail === "goal")
|
||||
await this._receiveGoal(data);
|
||||
await this._goalHandler(data); // TODO fix: extract goal data in separate function
|
||||
else if (data.detail === "finish")
|
||||
await this._finishHandler(data);
|
||||
}
|
||||
@ -169,7 +169,7 @@ export class PongGame extends AGame
|
||||
{
|
||||
let player = this.players.find((player) => player.id === data.user_id);
|
||||
|
||||
player.from_json(data);
|
||||
player.import(data);
|
||||
}
|
||||
|
||||
_updateBall(data)
|
||||
|
@ -120,7 +120,7 @@ class PongPlayer(APlayer):
|
||||
"username": self.username,
|
||||
"id": self.user_id,
|
||||
"position": self.position.to_dict(),
|
||||
"score": [*self.score],
|
||||
"score": self.score,
|
||||
|
||||
"rail": self.rail.to_dict(),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user