game: online: limit max ball speed
This commit is contained in:
@ -274,7 +274,7 @@ async def update_ball(game: PongGame, impact_data: dict):
|
||||
await asyncio.sleep(0.1) # create frontend animation
|
||||
await SyncToAsync(game.goal)(ret)
|
||||
else:
|
||||
game.ball.speed += config.BALL_SPEED_INC
|
||||
game.ball.speed = min(game.ball.speed + config.BALL_SPEED_INC, config.BALL_SPEED_MAX)
|
||||
game.ball.position.location = impact_data.get("impact")
|
||||
#game.ball.position.time = time.time() * 1000
|
||||
game.ball.angle = ret
|
||||
|
Reference in New Issue
Block a user