theouche merge ok

This commit is contained in:
CHIBOUB Chakib
2024-08-05 17:49:19 +02:00
7 changed files with 19 additions and 13 deletions

View File

@@ -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):

View File

@@ -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