Änderungen

This commit is contained in:
MaaaartinTH committed 2026-10-22 11:52:32 +02:00
1 parent 9d1ebda660
commit 60dc7cfd31
2 files changed
+7 -7

No files matched your search

+4 -4
View File
@@ -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]]])
+3 -3
View File
@@ -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()