core: split: game and pong
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user