Parametr in env datei, diese aber git ignored
This commit is contained in:
parent
59a55a5056
commit
efa15cbca3
6
.env
Normal file
6
.env
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
TITLE = "Moon"
|
||||||
|
FPS = 60
|
||||||
|
POSITION_MOON = (0, -150)
|
||||||
|
SIZE = (640, 400)
|
||||||
|
THETA = 0.01
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.env
|
||||||
@ -1,8 +1,19 @@
|
|||||||
|
import os
|
||||||
|
from dotenv import load_dotenv, dotenv_values
|
||||||
|
|
||||||
from game import Game
|
from game import Game
|
||||||
from moon import Moon
|
from moon import Moon
|
||||||
from compute import *
|
from compute import *
|
||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
title = str(os.getenv("TITLE"))
|
||||||
|
fps = str(os.getenv("FPS"))
|
||||||
|
size = str(os.getenv("SIZE"))
|
||||||
|
position_moon = str(os.getenv("POSITION_MOON"))
|
||||||
|
theta = str(os.getenv("THETA"))
|
||||||
|
|
||||||
|
|
||||||
WHITE = (255, 255, 255)
|
WHITE = (255, 255, 255)
|
||||||
BLACK = (0,0,0)
|
BLACK = (0,0,0)
|
||||||
RED = (255,0,0)
|
RED = (255,0,0)
|
||||||
@ -13,7 +24,7 @@ AP_RADIUS = 5
|
|||||||
|
|
||||||
|
|
||||||
class Apollo(Moon):
|
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)
|
super().__init__(title, fps, size)
|
||||||
self.position_moon = position_moon
|
self.position_moon = position_moon
|
||||||
self.position_ap = (0, 50)
|
self.position_ap = (0, 50)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user