def __init__(self): pygame.init() self._font = pygame.font.Font(None, 30) configuration = ResourceManager.load_config() self._screen = pygame.display.set_mode(configuration.get_resolution()) pygame.display.set_caption(configuration.get_name()) self._director = ResourceManager.load_director() self._farm_factory = None
def __init__(self, level, id, indic, once, coord, size, invert, action_data=None, locking=True): AbstractPlatform.__init__(self, level, None, True, pygame.Rect(coord, size), invert, not indic) self._id = id self._locking = locking self._once = once self._action_data = action_data self._director = ResourceManager.load_director() self._text = ResourceManager.get_text_repository() self._last = 0 self._has_interacted = False
#!/usr/bin/env python from game import ResourceManager from game.scenes import MainMenu import sys, getopt, os if __name__ == '__main__': sys.path.append(os.getcwd()) try: opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "invulnerable"]) except getopt.GetoptError as err: # print help information and exit: print(str(err)) # will print something like "option -a not recognized" sys.exit(2) invulnerable = False verbose = False for o, a in opts: if o in ("-h", "--help"): print("Options: --invulnerable --debug_scene=name") sys.exit() if o in ("-i", "--invulnerable"): invulnerable = True if o in ("-d", "--debug"): ResourceManager.enable_debug(a) director = ResourceManager.load_director() director.push_scene(MainMenu(invulnerable)) director.execute()