Exemple #1
0
def main():
    state = AppState()
    app = QApplication(sys.argv)
    ex = autoKomande.autoProzor(state)
    rez = app.exec_()
    state.close();
    sys.exit(rez)
Exemple #2
0
def main():
    state = AppState()
    app = QApplication(sys.argv)
    ex = noviProzor.Novi(state)
    rez = app.exec_()
    state.close();
    sys.exit(rez)
Exemple #3
0
def main():
    state = AppState()
    #state.sim();
    app = QApplication(sys.argv)
    ex = rucneKomande.rucneProzor(state)
    rez = app.exec_()
    state.close();
    sys.exit(rez)
    def setup(self):
        AppState.setup(self)

        self.menu = Menu()
        self.menu.add("Resume", None)
        self.menu.add("Restart", None)
        self.menu.add("Main Menu", None)
        self.menu.add("Exit", None)
        self.menu.build()

        # save app state
        self.game = self.app.state

        # render the screen background
        self.background = pygame.display.get_surface().convert()
        overlay = pygame.Surface(self.background.get_size())
        overlay.set_alpha(200)
        overlay.fill((0, 0, 0))

        self.background.blit(overlay, (0, 0))
    def test_can_save_state(self):
        state_file = os.path.join(tempfile.gettempdir(),
                                  next(tempfile._get_candidate_names()))

        app_state = AppState(state_file)

        app_state.some_property = 1
        app_state.save()

        app_state_2 = AppState(state_file)
        self.assertEqual(app_state_2.some_property, 1)
Exemple #6
0
    def setup(self):
        AppState.setup(self)

        self.level = Level(self.screen.get_size())
        self.level.restart()