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
def handle_events(): events = get_events() for event in events: if event.type == SDL_QUIT: framework.quit() elif(event.type, event.key) == (SDL_KEYDOWN, SDLK_p): framework.pop_state()
def handle_events(frame_time): bevents = get_events() for event in bevents: if event.type == SDL_QUIT: framework.quit() elif tpush > 1: if event.type == SDL_KEYDOWN: framework.quit()
def handle_events(frame_time): mevents = get_events() for event in mevents: if event.type == SDL_QUIT: framework.quit() else: if (event.type, event.key) == (SDL_KEYDOWN, SDLK_ESCAPE): framework.quit() else: io.proceed(event)
def handle_events(frame_time): global tpush bevents = get_events() for event in bevents: if event.type == SDL_QUIT or (event.type, event.key) == (SDL_KEYDOWN, SDLK_ESCAPE): framework.quit() elif tpush > 1.2: if (event.type, event.key) == (SDL_KEYDOWN, ord('x')): framework.quit()
def handle_events(frame_time): bevents = get_events() for event in bevents: if event.type == SDL_QUIT: framework.quit() else: if event.type == SDL_KEYDOWN: if event.key in (SDLK_p, SDLK_ESCAPE): framework.pop_state() audio_play("sndPauseOut") elif event.key is ord('z'): framework.quit()
def handle_events(frame_time): bevents = get_events() for event in bevents: if event.type == SDL_QUIT: framework.quit() else: if (event.type, event.key) == (SDL_KEYDOWN, SDLK_ESCAPE): framework.quit() elif (event.type, event.key) == (SDL_KEYDOWN, SDLK_RETURN): global logo_time, alpha if logo_time <= 0: if alpha > -alpha_max / 2: alpha = -alpha_max / 2 else: logo_time = 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)
def handle_events(): global selection events = get_events() for event in events: if event.type == SDL_QUIT: framework.quit() elif event.type == SDL_KEYDOWN: if event.key == SDLK_ESCAPE: framework.pop_state() if event.key == SDLK_UP: if selection == 0: selection = NUM_OF_ITEMS selection -= 1 if event.key == SDLK_DOWN: selection = (selection + 1) % NUM_OF_ITEMS if event.key == SDLK_SPACE: pass
def handle_events(): global selection events = get_events() for event in events: if event.type == SDL_QUIT: framework.quit() elif event.type == SDL_KEYDOWN: if event.key == SDLK_ESCAPE: framework.pop_state() if event.key == SDLK_UP: if selection == 0: selection = NUM_OF_MENUS selection -= 1 if event.key == SDLK_DOWN: selection = (selection + 1) % NUM_OF_MENUS if event.key == SDLK_SPACE: if selection == START_GAME: framework.change(main_game) elif selection == QUIT_GAME: framework.quit()
def handle_events(): global selection events = get_events() for event in events: if event.type == SDL_QUIT: framework.quit() elif event.type == SDL_KEYDOWN: if event.key in command_key_table: cheat_command.append(command_key_table[event.key]) check_command() if event.key == SDLK_ESCAPE: framework.pop_state() if event.key == SDLK_UP: if selection == 0: selection = NUM_OF_MENUS selection -= 1 if event.key == SDLK_DOWN: selection = (selection + 1) % NUM_OF_MENUS if event.key == SDLK_SPACE: if selection == RESUME_GAME: framework.pop_state()
def enter(self): self.window = Tk() self.window.geometry('300x300') self.window.title('StartState') label=Label(self.window,text="원 터치 벙커", font=('Times New Roman', 40),bg='white') label.img =PhotoImage(file ='Shild_Main_Map.png') label.config(image=label.img,compound='bottom') label.pack() Start=PhotoImage(file='Start_icon.png') b = Button(label,command=self.goSearchState ,width=100,height=40,image=Start) b.place(x=95, y=60) BookmarkStart = PhotoImage(file='bookmark_Start.png') d = Button(label, text="즐겨찾기", command=self.goBookMarkState,width=140,height=40,image=BookmarkStart) d.place(x=0, y=250) TelegramStart = PhotoImage(file='Telegram_icon.png') tb=Button(label,text="텔레그렘",command=self.TeleGramState,width=145,height=40,image=TelegramStart) tb.place(x=145,y=250) mainloop() framework.quit()
def handle_events(frame_time): global time, choice_state, selected bevents = get_events() for event in bevents: if event.type == SDL_QUIT: framework.quit() rewrite_option() elif time > 1: if event.type == SDL_KEYDOWN: if choice_state == -1: if event.key in (ord('z'), SDLK_ESCAPE): framework.pop_state() audio_play("sndMenuSelect") rewrite_option() elif event.key in (SDLK_LEFT, SDLK_RIGHT): selected = 1 - selected audio_play("sndMenuEnter") elif event.key in (ord('x'), SDLK_RETURN): choice_state = selected audio_play("sndMenuEnter") else: volsfx = audio_get_volume_sfx_global() volmus = audio_get_volume_music_global() if event.key in (ord('z'), SDLK_ESCAPE): choice_state = -1 audio_play("sndMenuSelect") elif event.key is SDLK_LEFT: if selected == 0: # Sound effect Volume audio_set_volume_sfx_global(volsfx - 1) elif selected == 1: # Music Volume audio_set_volume_music_global(volmus - 1) elif event.key is SDLK_RIGHT: if selected == 0: # Sound effect Volume audio_set_volume_sfx_global(volsfx + 1) elif selected == 1: # Music Volume audio_set_volume_music_global(volmus + 1)