From 05131dd4b22eb9fb47392142b3672dd10ac36895 Mon Sep 17 00:00:00 2001 From: starnakin Date: Tue, 14 May 2024 14:43:15 +0200 Subject: [PATCH] pong: fix: oline --- django/games/routine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/games/routine.py b/django/games/routine.py index 0c5c5d2..a4a30c0 100644 --- a/django/games/routine.py +++ b/django/games/routine.py @@ -130,7 +130,7 @@ def get_impact_point(segment: Segment, ball_segment: Segment) -> Point | None: def get_first_impact(segments: list[Segment], ball: Ball): cos: float = round(math.cos(ball.angle), 6) - sin: float = round(math.sin(ball.angle)) + sin: float = round(math.sin(ball.angle), 6) inc_x: float = (-1) * get_sign(cos) * (config.STROKE_THICKNESS + config.BALL_SIZE / 2) inc_y: float = get_sign(sin) * (config.STROKE_THICKNESS + config.BALL_SIZE / 2) @@ -276,7 +276,7 @@ async def update_ball(game: PongGame, impact_data: dict): else: game.ball.speed += config.BALL_SPEED_INC game.ball.position.location = impact_data.get("impact") - game.ball.position.time = time.time() * 1000 + #game.ball.position.time = time.time() * 1000 game.ball.angle = ret await SyncToAsync(game.broadcast)("update_ball", game.ball.to_dict())