Ejemplo n.º 1
0
def update(frame_time):
    global mainmenu
    mainmenu.update(frame_time)
    menum = mainmenu.depthlist[mainmenu.currdepth]

    if io.key_check_pressed(ord('z')):
        io.clear()
    elif io.key_check_pressed(SDLK_RETURN) or io.key_check_pressed(ord('x')):
        io.clear()
        audio_play("sndMenuSelect")

        if mn_begin == menum.menusel:
            framework.change_state(game)
        elif mn_opt == menum.menusel:
            io.clear()
            framework.push_state(main_option)
        elif mn_credit == menum.menusel:
            io.clear()
        elif mn_end == menum.menusel:
            framework.quit()
    elif io.key_check_pressed(SDLK_UP):
        if menum.menusel <= 0:
            menum.menusel = menum.menucnt - 1
        else:
            menum.menusel -= 1
    elif io.key_check_pressed(SDLK_DOWN):
        if menum.menusel >= menum.menucnt - 1:
            menum.menusel = 0
        else:
            menum.menusel += 1
Ejemplo n.º 2
0
def handle_events():
    events = pico2d.get_events()
    for event in events:
        if event.type == SDL_QUIT:
            framework.running = False
        elif event.type == SDL_KEYDOWN and event.key == SDLK_p:
            framework.push_state(state_Pause)
Ejemplo n.º 3
0
def handle_events():
    events = pico2d.get_events()
    for event in events:
        if event.type == SDL_QUIT:
            framework.running = False
        elif event.type == SDL_KEYDOWN and event.key == SDLK_RETURN:
            framework.push_state(state_Title)
            sound.stop()
Ejemplo n.º 4
0
def hit_starship():
    starship.explode()
    ui.add_event((LIFE, -1))
    ui.update()
    if ui.get_starship_life() == 0:
        framework.change_state(state_StageEnd)
    else:
        framework.push_state(state_StageRegen)
Ejemplo n.º 5
0
def stage_complete():
    stage_clear()

    audio_stream_stop()
    global stagelist
    if len(stagelist) > 0:
        framework.push_state(game_complete)
    else:
        framework.change_state(game_clear_all)
Ejemplo n.º 6
0
 def handle_events(self, frame_time):
     event_queue = get_events()
     for event in event_queue:
         if event.event == SDL_WINDOWEVENT_FOCUS_LOST:
             io.clear()
         elif event.type == SDL_QUIT:
             framework.quit()
         elif (event.type, event.key) == (SDL_KEYDOWN, SDLK_ESCAPE):
             framework.quit()
         elif (event.type, event.key) == (SDL_KEYDOWN, SDLK_p):
             io.clear()
             audio_play("sndPauseIn")
             framework.pause()
             framework.push_state(game_pause)
         else:
             io.proceed(event)
Ejemplo n.º 7
0
 def goSearchState(self):
     self.window.destroy()
     framework.push_state(searchState.SearchState())
     pass
Ejemplo n.º 8
0
 def TeleGramState(self):
     self.window.destroy()
     framework.push_state(teleGram.readyTeleGram())
     pass
Ejemplo n.º 9
0
 def goBookMarkState(self):
     self.window.destroy()
     framework.push_state(bookMarkState.BookMarkState())