Example #1
0
def update(event):
    if Et.game_state == GAMEINIT:
        Et.R_if.screen.blit(Et.R_if.main_bk_pic, (0, 0))
        mouseResponseGameInit(event)
        buttonShow()
        cursorShow()
    elif Et.game_state == GAMESETTING:
        Et.R_if.screen.blit(Et.R_if.main_bk_pic, (0, 0))
        mouseResponseGameSetting(event)
        settingShow()
        cursorShow()
    elif Et.game_state == GAMEHELP:
        Et.R_if.screen.blit(Et.R_if.main_bk_pic, (0, 0))
        mouseResponseGameHelp(event)
        helpShow()
        cursorShow()
    elif Et.game_state == GAMEINIT1:
        cursorShow()
        Et.R_gc = Rs.RChoose(game_file[0])
        Et.game_state = GAMESINGLECHOOSE
    elif Et.game_state == GAMESINGLECHOOSE:
        Et.R_if.screen.blit(Et.R_gc.bottom_pic, (0, 0))
        mouseResponseGameSingleChoose(event)
        singleChooseShow()
        cursorShow()
    elif Et.game_state == GAMELOADSUB:
        Et.R_pl = Rs.RCharacter(Et.R_gc.character_file[Et.player_choice])
        Et.R_em = Rs.REnemy(enemy_file[Et.game_choice])
        Et.R_ob = Rs.RObstacle(obstacle_file[Et.game_choice])
        for i in range(0, 3):
            Et.R_sk[i] = Rs.RSkill(skill_file[Et.R_pl.skill[i]])
        Et.R_sg = Rs.RSingle(game_file[1][Et.game_choice])
        Et.game_state = GAMELOAD
    elif Et.game_state == GAMELOAD:
        Et.game_state = GAMESTART
    elif Et.game_state == GAMESTART:
        Et.I_ctr.update()
        gameBlit()
        #test_case.test()
    elif Et.game_state == GAMEONLINEINIT1:
        Et.R_pl = Rs.RCharacter(character_file[Et.player_choice])
        Et.R_sg = Rs.RSingle(game_file[1][Et.game_choice])
        Et.game_state = GAMEONLINEINIT2
    elif Et.game_state == GAMEONLINEINIT2:
        Et.game_state = GAMEONLINE
    elif Et.game_state == GAMEONLINE:
        Et.I_ctr.update()
        onlineBlit()