diff --git a/Game.py b/Game.py index 35330af..410638a 100644 --- a/Game.py +++ b/Game.py @@ -20,7 +20,8 @@ from panda3d.core import loadPrcFile #Ermöglicht das Laden eigener Konfiguratio import random class game(ShowBase): - + __debug_mode = [0,1,2,3,4] + __debuglevel = 0 __us = User.User __statics = Statics.statics #__ctrl = Controls.controls @@ -67,6 +68,11 @@ class game(ShowBase): #Zusatzfunktionen innerhalb instanzierter ShowBase-Klasse def update_keystate(self, controlName, controlState): self.__keymap[controlName] = controlState + + def setDebugMode(self, debugmode:int): + """DEBUGLEVEL""" + self.__debuglevel = debugmode + #Taskfunctions and definitions def task1(self, task): @@ -82,19 +88,19 @@ class game(ShowBase): def keyboard_event(self, task): - print(self.__keymap) + if(self.__debuglevel == 4): print(self.__keymap) if (self.__keymap['up']): self.__actor1.setPos(self.__actor1.getPos() + Vec3(0,0.2,0)) - print("Nach oben!") + if(self.__debuglevel >= 3): print("Nach oben!") if (self.__keymap['down']): self.__actor1.setPos(self.__actor1.getPos() - Vec3(0,0.2,0)) - print("Nach unten!") + if(self.__debuglevel >= 3): print("Nach unten!") if (self.__keymap['left']): self.__actor1.setPos(self.__actor1.getPos() - Vec3(0.2,0,0)) - print("Nach links!") + if(self.__debuglevel >= 3): print("Nach links!") if (self.__keymap['right']): self.__actor1.setPos(self.__actor1.getPos() + Vec3(0.2,0,0)) - print("Nach rechts!") + if(self.__debuglevel >= 3): print("Nach rechts!") return Task.cont \ No newline at end of file diff --git a/SnakeTest.py b/SnakeTest.py index 18cdbc2..4bae881 100644 --- a/SnakeTest.py +++ b/SnakeTest.py @@ -9,9 +9,10 @@ import subprocess def __main__(): #label = subprocess.check_output(["git", "describe"]).strip() def get_git_revision_hash(): - return subprocess.check_output(['git', 'rev-parse', 'HEAD']) + return subprocess.check_output(['git', 'rev-parse', 'HEAD']) game = Game.game() + game.setDebugMode(3) game.run() return 0 diff --git a/Statics.py b/Statics.py index dd6222a..a5e6fe2 100644 --- a/Statics.py +++ b/Statics.py @@ -7,9 +7,9 @@ class statics: - def __init__(self) -> None: - for x in self._menupoints: - print(x) + #def __init__(self) -> None: + # for x in self._menupoints: + # print(x) - pass + # pass