pong: fix: oline

This commit is contained in:
starnakin 2024-05-14 14:43:15 +02:00
parent 69b963a65e
commit 05131dd4b2

View File

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