26 lines
719 B
Python
26 lines
719 B
Python
import pygame
|
|
|
|
from game.Moon import Moon
|
|
from numeric.compute import rot_2D, matmul
|
|
|
|
|
|
class Apollo(Moon):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.orbiter_position = None
|
|
self.orbiter_distance = [[50], [0]]
|
|
|
|
def update_game(self):
|
|
super().update_game()
|
|
rot = rot_2D(-self.angle)
|
|
rotated = matmul(rot, self.orbiter_distance)
|
|
self.orbiter_position = (
|
|
int(self.moon_position[0] + rotated[0][0]),
|
|
int(self.moon_position[1] + rotated[1][0])
|
|
)
|
|
return True
|
|
|
|
def draw_game(self):
|
|
super().draw_game()
|
|
pygame.draw.circle(self.screen, (255,0,0), self.orbiter_position, 4)
|
|
pygame.display.flip() |