Some other changes in game.py
This commit is contained in:
3
Controls.py
Normal file
3
Controls.py
Normal file
@@ -0,0 +1,3 @@
|
||||
class controls():
|
||||
def __init__() -> None:
|
||||
pass
|
||||
29
Game.py
29
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
__main__()
|
||||
15
Statics.py
15
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user