game: core: use server game calulation form

This commit is contained in:
2024-01-17 14:23:23 +01:00
parent b2dc43c1d8
commit 2bd0624100
15 changed files with 274 additions and 110 deletions

View File

@ -3,7 +3,19 @@ from .. import config
class Ball:
def __init__(self) -> None:
self.x: float = config.BALL_SPAWN_POS_X
self.y: float = config.BALL_SPAWN_POS_Y
self.speed: float = config.BALL_SPEED_START
self.postion_x: float = config.BALL_SPAWN_POS_X
self.postion_y: float = config.BALL_SPAWN_POS_Y
self.velocity_x: float = config.BALL_SPEED_START
self.velocity_y: float = config.BALL_SPEED_START
def to_dict(self):
data: dict = {
"position_x": self.postion_x,
"position_y": self.postion_y,
"velocity_x": self.velocity_x,
"velocity_y": self.velocity_y,
}
return data