Compare commits

...

2 Commits

Author SHA1 Message Date
Julia
2b6a708f6c mit env datei 2025-10-31 14:50:05 +01:00
Julia
efa15cbca3 Parametr in env datei, diese aber git ignored 2025-10-31 14:37:09 +01:00
3 changed files with 20 additions and 2 deletions

6
.env Normal file
View File

@ -0,0 +1,6 @@
TITLE="Moon"
FPS=60
POSITION_MOON=0,-150
SIZE=640,400
THETA=0.01

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

View File

@ -1,8 +1,19 @@
import os
from dotenv import load_dotenv, dotenv_values
from game import Game
from moon import Moon
from compute import *
import pygame
load_dotenv()
title = str(os.getenv("TITLE"))
fps = int(os.getenv("FPS"))
size = tuple(map(int, os.getenv("SIZE").split(',')))
theta = float(os.getenv("THETA"))
position_moon = tuple(map(int, os.getenv("POSITION_MOON").split(',')))
WHITE = (255, 255, 255)
BLACK = (0,0,0)
RED = (255,0,0)
@ -13,7 +24,7 @@ AP_RADIUS = 5
class Apollo(Moon):
def __init__(self, title="Apollo", fps=60, size=(640, 400), position_moon=(0, -150), theta=0.01):
def __init__(self, title, fps, size, position_moon, theta):
super().__init__(title, fps, size)
self.position_moon = position_moon
self.position_ap = (0, 50)
@ -48,6 +59,6 @@ class Apollo(Moon):
if __name__ == "__main__":
# created by me and only me
game = Apollo()
game = Apollo(title, fps, size, position_moon, theta)
game.run()