game: core: use server game calulation form
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user