core: split: game and pong

This commit is contained in:
2024-04-05 17:47:17 +02:00
parent c49e721e5a
commit f6f59f8ead
34 changed files with 965 additions and 784 deletions

View File

@ -2,14 +2,16 @@ from __future__ import annotations
from .. import config
from .Position import Position
from .Point import Point
import time
import math
class Ball:
def __init__(self) -> None:
self.size: float
self.position: Point
self.position: Position
self.angle: float
self.speed: float
@ -17,7 +19,7 @@ class Ball:
def reset(self) -> None:
self.size = config.BALL_SIZE
self.position = Point(config.BALL_SPAWN_POS_X + self.size / 2, config.BALL_SPAWN_POS_Y + self.size / 2)
self.position = Position(Point(config.BALL_SPAWN_POS_X + self.size / 2, config.BALL_SPAWN_POS_Y + self.size / 2), time.time())
self.angle = math.pi * 0.3
self.speed = config.BALL_SPEED_START