def create(screen_width, screen_height, tile_size, origin_xy=(0, 0)): """ TODO """ state = [None for x in xrange(13)] tile_size = (tile_size) screen_width = (screen_width) screen_height = (screen_height) origin_xy = ((origin_xy[0]), (origin_xy[1])) screen.initialize(0, state, screen_width, screen_height, tile_size, origin_xy) texture_db.initialize(1, state) tiles.initialize(2, state, tile_size) sprites.initialize(3, state) movers.initialize(4, state) entities.initialize(5, state) view.initialize(6, state) controls.initialize(7, state) collisions.initialize(8, state) text.initialize(9, state) timer.initialize(10, state) debug.initialize(11, state) user.initialize(12, state) return state
def start(self, dim): screen.initialize(self.title, dim) f = open("./content/level/test.lvl", "r") self.level_state = pickle.load(f) self.register_session(PLAY, TouhouPlay(self.level_state)) self.load_session(PLAY) self.session.start()
def create(screen_width, screen_height, tile_size, origin_xy=(0, 0)): """ TODO """ state = [None for x in xrange(globals.IDX_STATE_LAST)] screen.initialize(state, screen_width, screen_height, tile_size, origin_xy) texture_db.initialize(state) tiles.initialize(state, tile_size) sprites.initialize(state) movers.initialize(state) entities.initialize(state) view.initialize(state) controls.initialize(state) collisions.initialize(state) text.initialize(state) timer.initialize(state) return state
help="Milliseconds between firings") # Parse the options (options, args) = parser.parse_args() # Populate variables corresponding to user-supplied options num_enemies = int(options.num_enemies) # Number of enemies to spawn firing_rate = int( options.firing_rate) # Number of milliseconds between firings ############################################################# # Initialize Objects ############################################################# # Game container & objects screen = qb_screen.initialize() clock = pygame.time.Clock() # Active agents in game qubert = qb_qubert.Qubert(screen) enemies = qb_enemies.Enemies(screen, num_enemies) turrets = qb_turrets.Turrets(screen, firing_rate) ############################################################# # Set initial game-play state variables ############################################################# running = True paused = False #############################################################