Example #1
0
 def load_font(font_path):
     font_folder_path = Path(
         path.realpath(__file__)).parent.parent.parent.parent / "res/fonts"
     font_loader = Loader(GUIFontLoader.base)
     return font_loader.loadFont(
         Filename(font_folder_path / font_path).cStr())
Example #2
0
    29.0 / 30.0
)  #The test distance. If asteroid greater than asteroid_test_distancem then it will be moved closer
score = 0  # Initialize score
fullscreen = False
Frames = False
test_max_min = [0, 0, 0, 0]
max_player_speed = 300000
pointball_value = 0
title_screen = None
is_living = True
resolution = (800, 600)
fog_quality = 0.000002
cursor_hidden = False
# Windows settings
loadPrcFileData('', 'window-title Space Rocks!')
thunderstrike = Loader.loadFont(0, "./Fonts/thunderstrike.ttf")
thunderstrike3d = Loader.loadFont(0, "./Fonts/thunderstrike3d.ttf")


class Begin(ShowBase):
    def __init__(self):
        global pointball_value
        global title_screen
        global loading_screen
        # Basics
        ShowBase.__init__(self)
        #Setup the window
        base.disableMouse()
        render.setAntialias(AntialiasAttrib.MAuto)
        self.set_windowsettings()
        base.camLens.setFar(asteroid_spawn_distance * 100)