Merge branch 'main' of github.com:AudebertAdrien/ft_transcendence into trash

This commit is contained in:
Theouche
2024-08-07 14:09:50 +02:00
10 changed files with 31 additions and 19 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

View File

@@ -1,4 +1,4 @@
# Generated by Django 5.0.7 on 2024-07-31 15:16
# Generated by Django 5.0.7 on 2024-07-31 16:01
import django.db.models.deletion
from django.db import migrations, models

View File

@@ -1,4 +1,4 @@
# Generated by Django 5.0.7 on 2024-07-31 16:58
# Generated by Django 5.0.7 on 2024-07-31 16:04
import django.db.models.deletion
from django.db import migrations, models