Cleanup, some tests

This commit is contained in:
2023-12-22 18:05:17 +01:00
parent d52d601408
commit d811547366

19
Game.py
View File

@@ -26,7 +26,7 @@ class game(ShowBase):
#__ctrl = Controls.controls
# __game_mechanics = Game_Mechanics.Game_Mechanics()
__onscreentext1 = OnscreenText
__actor1 = Actor
__p3d_conf = loadPrcFile("conf/conf.prc") #Pfadangabe zum .prc File
@@ -38,12 +38,23 @@ class game(ShowBase):
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.__onscreentext1.setText("Ich bewege mich fortlaufen!")
self.actor1 = Actor("data/models/myfile.bam")
self.actor1.reparentTo(self.render)
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!")
_x = -2.8 + (task.time*0.3)
print("Task läuft seit: " + str(_x))
self.__onscreentext1.setPos(x=_x, y=0)
if (_x >= 2.8000):
print("Finished")
return Task.again
return Task.cont