diff --git a/Controls.py b/Controls.py new file mode 100644 index 0000000..190ec72 --- /dev/null +++ b/Controls.py @@ -0,0 +1,3 @@ +class controls(): + def __init__() -> None: + pass \ No newline at end of file diff --git a/Game.py b/Game.py index a07c69f..763df4b 100644 --- a/Game.py +++ b/Game.py @@ -1,5 +1,6 @@ import User import Statics +import Controls from math import pi, sin, cos from direct.showbase.ShowBase import ShowBase @@ -16,21 +17,35 @@ from panda3d.core import TextNode #Texte from direct.task import Task from panda3d.core import Vec4, Vec3 from panda3d.core import loadPrcFile #Ermöglicht das Laden eigener Konfigurationsdatein zur Panda3D API - - +import random -class Game(ShowBase): +class game(ShowBase): __us = User.User + __statics = Statics.statics + #__ctrl = Controls.controls # __game_mechanics = Game_Mechanics.Game_Mechanics() - - loadPrcFile("conf/conf.prc") #Pfadangabe zum .prc File + __onscreentext1 = OnscreenText + + __p3d_conf = loadPrcFile("conf/conf.prc") #Pfadangabe zum .prc File def __init__(self) -> None: ShowBase.__init__(self) - __us = User.User() + self.__us = User.User() + self.__statics = Statics.statics() + #self.__ctrl = Controls.controls(self) + font1 = self.loader.load_font("/usr/share/fonts/TTF/Inconsolata-UltraExpandedExtraBold.ttf") + self.__onscreentext1 = OnscreenText(self.__statics._menupoints[0], font=font1, pos= (0.1,0)) + + self.taskMgr.add(self.task1, "task1") + + def task1(self, task): + print("Task läuft seit: " + str(task.time)) + self.__onscreentext1.setText("Ich bewege mich fortlaufen!") + return Task.cont + - \ No newline at end of file + \ No newline at end of file diff --git a/SnakeTest.py b/SnakeTest.py index 69f54be..5a8525f 100644 --- a/SnakeTest.py +++ b/SnakeTest.py @@ -1,12 +1,14 @@ import Game import User +import Controls def __main__(): - game = Game.Game() + game = Game.game() game.run() + return 0 + if __name__ == "__main__": - __main__() - pass \ No newline at end of file + __main__() \ No newline at end of file diff --git a/Statics.py b/Statics.py index e69de29..dd6222a 100644 --- a/Statics.py +++ b/Statics.py @@ -0,0 +1,15 @@ +class statics: + + _menutitle = "Hauptmenü" + _menupoints = ("Einstellungen", + "Highscore") + _version = "1.0" + + + + def __init__(self) -> None: + for x in self._menupoints: + print(x) + + pass +