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

@ -45,11 +45,11 @@ class GameModel(models.Model):
return score_data
def add_goal(self, goal_taker_id: int):
def add_goal(self, goal_defenser: User):
timestamp: int = round(time.time() * 1000, 1) - self.start_timestamp
goal_model: GameGoalModel = GameGoalModel.objects.create(player_id = goal_taker_id, game_id = self.pk, timestamp = timestamp)
goal_model: GameGoalModel = GameGoalModel(player=goal_defenser, game=self, timestamp=timestamp)
goal_model.save()