예제 #1
0
파일: world.py 프로젝트: kxgames/Pong
    def __init__(self):
        Sprite.__init__(self)

        speed = settings.ball_speed
        direction = Vector.random()

        x, y = abs(direction)
        if y > x:
            direction = direction.orthogonal

        self.shape = settings.ball_shape
        self.velocity = speed * direction
예제 #2
0
파일: world.py 프로젝트: kxgames/Pong
 def __init__(self):
     Sprite.__init__(self)
     self.shape = settings.paddle_shape.copy()
     self.velocity = 0
     self.score = 0
     self.target = Vector(0, 0)