Cleanup, some tests
This commit is contained in:
19
Game.py
19
Game.py
@@ -26,7 +26,7 @@ class game(ShowBase):
|
|||||||
#__ctrl = Controls.controls
|
#__ctrl = Controls.controls
|
||||||
# __game_mechanics = Game_Mechanics.Game_Mechanics()
|
# __game_mechanics = Game_Mechanics.Game_Mechanics()
|
||||||
__onscreentext1 = OnscreenText
|
__onscreentext1 = OnscreenText
|
||||||
|
__actor1 = Actor
|
||||||
__p3d_conf = loadPrcFile("conf/conf.prc") #Pfadangabe zum .prc File
|
__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")
|
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 = 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")
|
self.taskMgr.add(self.task1, "task1")
|
||||||
|
|
||||||
def task1(self, task):
|
def task1(self, task):
|
||||||
print("Task läuft seit: " + str(task.time))
|
_x = -2.8 + (task.time*0.3)
|
||||||
self.__onscreentext1.setText("Ich bewege mich fortlaufen!")
|
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
|
return Task.cont
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user