def __init__(self, *args, **kwargs):
        super(SizedButton, self).__init__(*args, **kwargs)

        self.Globals = get_Globals()
        self.image = None
        self.imageHolder = None
        self.size_hint = None, None
Esempio n. 2
0
def add_save_paths(app):
    Globals = get_Globals()

    Globals.User_data.save_path = str(
        os.path.join(str(app.user_data_dir), "user_data.json"))
    Globals.Settings_data.save_path = str(
        os.path.join(str(app.user_data_dir), "settings_data.json"))

    Logger.info("Loader: Added save paths")
Esempio n. 3
0
def create_Globals(app):
    init()
    Globals = get_Globals()

    Globals.width = Window.width
    Globals.height = Window.height
    Globals.app = app

    Logger.info("Loader: Created Globals")
    def __init__(self, *args, **kwargs):
        super(BaseBuilderScreen, self).__init__(*args, **kwargs)

        self.Globals = get_Globals()

        self.baseBuilder = None
        self.baseBuilderHolder = None

        Logger.info("Application: BaseBuilder Screen vars setup")
Esempio n. 5
0
    def __init__(self, *args, **kwargs):
        super(BaseBuilder, self).__init__(*args, **kwargs)
        self.drawClock = None

        self.Globals = get_Globals()

        self.size = self.Globals.width, self.Globals.width

        self.bg = FloatLayout()
        self.buildings = FloatLayout()

        self.add_widget(self.bg)
        self.add_widget(self.buildings)
    def __init__(self):
        super(ScreenManager, self).__init__()

        Globals = get_Globals()

        self.width = Globals.width
        self.height = Globals.height


        #  So things actually work
        dumpScreen = Screen(name="DumpScreen")
        self.add_widget(dumpScreen)

        #  Intro Screens
        introScreen = IntroScreen(name="IntroShipScreen")
        crashScreen = CrashScreen(name="IntroCrashScreen")
        self.add_widget(introScreen)
        self.add_widget(crashScreen)

        # Main Screens
        baseBuildScreen = BaseBuilderScreen(name="BaseBuilderScreen")
        self.add_widget(baseBuildScreen)

        #  Settings Screens
        settingsScreen = SettingsScreen(name="SettingsScreen")
        self.add_widget(settingsScreen)

        #  Inventory Screens
        buildingScreen = BuildingScreen(name="BuildingScreen")
        self.add_widget(buildingScreen)




        if Globals.User_data.get("introFinished"):
            self.current = "BaseBuilderScreen"
            Logger.info("Application: Starting in BaseBuilder")

        else:
            Logger.info("Application: Starting in Intro")
            self.current = "IntroShipScreen"

        Logger.info("Application: Screen Manager setup")
Esempio n. 7
0
    def __init__(self, *args, **kwargs):
        super(Building, self).__init__(*args, **kwargs)
        self.Globals = get_Globals()

        size = self.Globals.width / self.Globals.GameSettings.base_builder_building_size_divider
        self.size = size, size

        state = str(0)
        textureInfo = self.Globals.BuildingTextures.get_texture_info(self.name)
        for s in textureInfo:
            if textureInfo[s]["data"] == self.data:
                state = str(s)
                break

        self.frameStep = textureInfo[state]["frameStep"]
        self.lastFrame = textureInfo[state]["lastFrame"]
        self.animated = textureInfo[state]["animated"]
        self.rotatable = textureInfo[state]["rotatable"]

        self.Globals.BuildingSelectionHandler.register_building(self)
    def __init__(self, *args, **kwargs):
        super(CrashScreen, self).__init__(*args, **kwargs)

        self.Globals = get_Globals()

        self.canyonClock = None
        self.starClock = None
        self.drawClock = None
        self.guideClock = None
        self.click1Clock = None

        self.starLayout = None
        self.canyonLayout = None
        self.guideLayout1 = None
        self.guideLayout2 = None

        self.currentClick = 0

        ratio = self.Globals.Textures.cliff_edge_stars.width / self.Globals.Textures.cliff_edge_stars.height
        self.h = self.Globals.height
        self.w = ratio * self.h

        Logger.info("Application: IntroCrash Screen vars setup")
Esempio n. 9
0
def load_audio(app):
    Globals = get_Globals()
    Globals.Audio.load()

    Logger.info("Loader: Loaded Audio")
Esempio n. 10
0
def load_textures(app):
    Globals = get_Globals()
    Globals.Textures.load()

    Logger.info("Loader: Loaded Textures")
Esempio n. 11
0
    def __init__(self, *args, **kwargs):
        super(IntroScreen, self).__init__(*args, **kwargs)
        self.starClock = None
        self.shipClock = None
        self.shipShakeClock = None
        self.meteorHitSoundClock = None
        self.meteorClock = None
        self.meteorClock2 = None
        self.tintClock = None
        self.tintClock2 = None
        self.alarmSoundClock = None
        self.alarmSoundClock2 = None
        self.alarmSoundStopClock = None
        self.shipFallClock = None
        self.shipFallSoundClock = None
        self.endClock = None

        self.shipLayout = None
        self.starsLayout = None
        self.meteorLayout = None
        self.tintLayout = None

        self.Globals = get_Globals()

        self.shakeScreenX = self.Globals.width / self.Globals.GameSettings.intro_ship_ship_shake_amount_divider * -1
        self.shakeScreenY = self.Globals.height / self.Globals.GameSettings.intro_ship_ship_shake_amount_divider * -1
        self.shakeDistanceX = self.shakeScreenX * -1
        self.shakeDistanceY = self.shakeScreenX * -1
        self.shakeScreenWidth = self.Globals.width - (self.shakeScreenX * 2)
        self.shakeScreenHeight = self.Globals.height - (self.shakeScreenY * 2)

        img = self.Globals.Textures.ship_inside_1
        width = img.size[0]
        height = img.size[1]

        ratio = self.shakeScreenHeight / self.shakeScreenWidth
        ratio2 = height / width

        takeAway = ratio - ratio2

        new_width = width - (width * takeAway)

        left = (width - new_width) / 2
        top = 0
        right = (width + new_width) / 2
        bottom = height

        img = img.crop((left, top, right, bottom))

        data = BytesIO()
        img.save(data, format='png')
        data.seek(0)
        self.shipImageTexture1 = CoreImage(BytesIO(data.read()), ext='png').texture

        img = self.Globals.Textures.ship_inside_2
        width = img.size[0]
        height = img.size[1]

        ratio = self.shakeScreenHeight / self.shakeScreenWidth
        ratio2 = height / width

        takeAway = ratio - ratio2

        new_width = width - (width * takeAway)

        left = (width - new_width) / 2
        top = 0
        right = (width + new_width) / 2
        bottom = height

        img = img.crop((left, top, right, bottom))

        data = BytesIO()
        img.save(data, format='png')
        data.seek(0)
        self.shipImageTexture2 = CoreImage(BytesIO(data.read()), ext='png').texture

        self.shipImageTexture = self.shipImageTexture1


        Logger.info("Application: IntroShip Screen vars setup")
    def on_stop(self):
        Globals = get_Globals()
        Globals.User_data.save()
        Globals.Settings_data.save()

        sys.exit()
    def __init__(self, *args, **kwargs):
        super(BetterScatter, self).__init__(*args, **kwargs)

        self.Globals = get_Globals()