diff --git a/Moon.py b/Moon.py index 02ef740..4d511cd 100644 --- a/Moon.py +++ b/Moon.py @@ -6,7 +6,7 @@ from game import Game EARTH_RADIUS = 30 MOON_RADIUS = 10 MOON_DISTANCE = 100.0 -MOON_ANGLE = 0.01 +theta = 0.01 BLACK = (0, 0, 0) BLUE = (0, 0, 255) @@ -17,14 +17,14 @@ class Moon(Game): """Der Mond kreist um die Erde.""" def __init__(self, title="Moon", fps=60, size=(640, 400)): - super().__init__(title, fps, size) + super().__init__(title, fps, size) # Ruft Konstruktor von Game auf self.center_x = size[0] // 2 - self.center_y = size[1] // 2 + self.center_y = size[1] // 2 # Center position von Erde self.init_positions() def init_positions(self): self.position_moon = (MOON_DISTANCE, 0.0) - self.rot_moon = rot_2D(MOON_ANGLE) + self.rot_moon = rot_2D(theta) def rotate_point(self, position, rotation): result = matmul(rotation, [[position[0]], [position[1]]]) diff --git a/apollo.py b/apollo.py index 2d0a10a..8fbfdee 100644 --- a/apollo.py +++ b/apollo.py @@ -1,11 +1,11 @@ import pygame -from Moon import MOON_ANGLE, Moon +from Moon import Moon from compute import rot_2D APOLLO_DISTANCE = 40.0 APOLLO_RADIUS = 5 -APOLLO_ANGLE = -2 * MOON_ANGLE +theta = -0.02 RED = (255, 0, 0) @@ -18,7 +18,7 @@ class Apollo(Moon): def init_positions(self): super().init_positions() self.position_apollo = (APOLLO_DISTANCE, 0.0) - self.rot_apollo = rot_2D(APOLLO_ANGLE) + self.rot_apollo = rot_2D(theta) def update_positions(self): super().update_positions()