mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2026-11-09 18:17:07 +01:00
theouche merge ok
This commit is contained in:
@@ -126,9 +126,13 @@ class Game:
|
||||
# Check for scoring
|
||||
if self.game_state['ball_position']['x'] <= 10:
|
||||
self.game_state['player2_score'] += 1
|
||||
if self.game_state['player2_score'] >= 5:
|
||||
self.end_game()
|
||||
self.reset_ball()
|
||||
elif self.game_state['ball_position']['x'] >= 790:
|
||||
self.game_state['player1_score'] += 1
|
||||
if self.game_state['player1_score'] >= 5:
|
||||
self.end_game()
|
||||
self.reset_ball()
|
||||
|
||||
def reset_ball(self):
|
||||
|
||||
@@ -40,7 +40,7 @@ class MatchMaker:
|
||||
await asyncio.sleep(1)
|
||||
self.timer += 1
|
||||
# Waiting for more than 30s -> BOT game
|
||||
if self.timer >= 3 and self.waiting_players:
|
||||
if self.timer >= 30 and self.waiting_players:
|
||||
player1 = self.waiting_players.pop(0)
|
||||
print(f"*** MATCH FOUND: {player1.user.username} vs BOT")
|
||||
self.botgame = True
|
||||
|
||||
Reference in New Issue
Block a user