Exemple #1
0
        public static int pause_action(int i)
        {
            Audio.audio_play(Common.AUD_MENU, 1.0f);

            switch (i)
            {
            case st_pause.PAUSE_CONTINUE:
                Video.video_set_grab(0);
                return(State.goto_state(st_pause.st_continue));

            case st_pause.PAUSE_RESTART:
                if (Progress.progress_same() != 0)
                {
                    st_pause.clear_pause();
                    Video.video_set_grab(1);
                    return(State.goto_state(st_play.get_st_play_ready()));
                }
                break;

            case st_pause.PAUSE_EXIT:
                Progress.progress_stat(GAME.GAME_NONE);
                st_pause.clear_pause();
                Audio.audio_music_stop();
                return(State.goto_state(st_over.get_st_ball_over()));
            }

            return(1);
        }
Exemple #2
0
        public static int pause_or_exit()
        {
            if (Config.config_tst_d(Config.CONFIG_KEY_PAUSE, Alt.GUI.Keys.Escape) != 0)
            {
                return(st_pause.goto_pause());
            }
            else
            {
                Progress.progress_stat(GAME.GAME_NONE);

                Video.video_clr_grab();

                return(State.goto_state(st_over.get_st_ball_over()));
            }
        }
Exemple #3
0
        internal override void OnTimer(int id, float dt)
        {
            float k = (st_play.fast_rotate != 0 ?
                       (float)Config.config_get_d(Config.CONFIG_ROTATE_FAST) / 100.0f :
                       (float)Config.config_get_d(Config.CONFIG_ROTATE_SLOW) / 100.0f);

            gui.gui_timer(id, dt);
            hud.hud_timer(dt);
            game_server.game_set_rot(st_play.view_rotate * k);
            game_server.game_set_cam(Config.config_get_d(Config.CONFIG_CAMERA));

            game_client.game_step_fade(dt);

            game_server.game_server_step(dt);
            game_client.game_client_step();

            switch (game_client.curr_status())
            {
            case (int)GAME.GAME_GOAL:
                Progress.progress_stat(GAME.GAME_GOAL);
                State.goto_state(st_goal.get_st_ball_goal());
                break;

            case (int)GAME.GAME_FALL:
                Progress.progress_stat(GAME.GAME_FALL);
                State.goto_state(st_fall_out.get_st_fall_out());
                break;

            case (int)GAME.GAME_TIME:
                Progress.progress_stat(GAME.GAME_TIME);
                State.goto_state(st_time_out.get_st_time_out());
                break;

            default:
                Progress.progress_step();
                break;
            }
        }
Exemple #4
0
        internal override int OnKeybd(Alt.GUI.Keys c, int d)
        {
            if (d != 0)
            {
                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_R, c) != 0)
                {
                    st_play.view_rotate = +1;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_L, c) != 0)
                {
                    st_play.view_rotate = -1;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_ROTATE_FAST, c) != 0)
                {
                    st_play.fast_rotate = 1;
                }

                st_play.keybd_camera(c);

                if (Config.config_tst_d(Config.CONFIG_KEY_RESTART, c) != 0 &&
                    Progress.progress_same_avail() != 0)
                {
                    if (Progress.progress_same() != 0)
                    {
                        State.goto_state(st_play.get_st_play_ready());
                    }
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_PAUSE, c) != 0)
                {
                    st_pause.goto_pause();
                }
            }
            else
            {
                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_R, c) != 0)
                {
                    st_play.view_rotate = 0;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_CAMERA_L, c) != 0)
                {
                    st_play.view_rotate = 0;
                }

                if (Config.config_tst_d(Config.CONFIG_KEY_ROTATE_FAST, c) != 0)
                {
                    st_play.fast_rotate = 0;
                }
            }

            if (d != 0 &&
                c == Alt.GUI.Keys.F12 &&
                Config.config_cheat() != 0)
            {
                return(State.goto_state(st_play.get_st_look()));
            }

            if (d != 0 &&
                c == Alt.GUI.Keys.F6)
            {
                st_play.show_hud =
                    //!st_play.show_hud;
                    st_play.show_hud == 0 ? 1 : 0;
            }

            if (d != 0 &&
                c == Alt.GUI.Keys.C &&
                Config.config_cheat() != 0)
            {
                Progress.progress_stat(GAME.GAME_GOAL);
                return(State.goto_state(st_goal.get_st_ball_goal()));
            }

            return(1);
        }