Exemplo n.º 1
0
        IEnumerator loop()
        {
            replay_manager_.startRecording((double)Time.time);
            for (var i = 0; i < 7; ++i)
            {
                MyTransform tfm = new MyTransform();
                tfm.position_ = new Vector3(i, 0f, 0f);
                try {
                    replay_manager_.update((double)i, ref tfm, false /* is_fire_button_pressed */);
                } catch (System.Exception e) {
                    Debug.LogError(e);
                }
            }
            replay_manager_.stopRecording();

            yield return(null);

            replay_manager_.startPlaying((double)Time.time, null /* player */);
            for (var i = 0; i < 24; ++i)
            {
                MyTransform tfm = new MyTransform();
                try {
                    bool is_fire_button_pressed = false;
                    replay_manager_.getFrameData((double)(i - 2) * 0.33333, ref tfm, ref is_fire_button_pressed);
                } catch (System.Exception e) {
                    Debug.LogError(e);
                }
                Debug.LogFormat("{0}:pos_x:{1}", (double)(i - 2) * 0.33333, tfm.position_.x);
            }
            replay_manager_.stopPlaying(null /* player */);
            yield return(null);
        }
Exemplo n.º 2
0
        private IEnumerator act()
        {
            game_phase_ = GamePhase.Title;
            Player.Instance.setPhaseTitle();
            Player.Instance.setPositionXY(0f, -27f);
            SystemManager.Instance.registBgm(DrawBuffer.BGM.Stop);
            SystemManager.Instance.registMotion(DrawBuffer.Motion.Play);
            SystemManager.Instance.setFlowSpeed(0f);
            SystemManager.Instance.setSubjective(true);

            for (var w = new Utility.WaitForSeconds(4f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Notice notice;
            {
                notice = Notice.create(-400f, 400f,
                                       MySprite.Kind.GamePadPress,
                                       MySprite.Type.Full,
                                       false /* blink */);
            }
            var leave_time_start = update_time_;

            while (game_phase_ == GamePhase.Title)
            {
                bool exit_title   = false;
                var  elapsed_time = update_time_ - leave_time_start;
                if (InputManager.Instance.getButton(InputManager.Button.Fire) > 0)
                {
                    exit_title = true;
                    replay_manager_.startRecording(update_time_);
                    replay_mode_ = false;
                }
                else
                {
                    if (replay_manager_.hasRecorded())
                    {
                        bool start_replay = false;
                        if (replay_mode_)
                        {
                            if (elapsed_time > 1f)
                            {
                                start_replay = true;
                            }
                        }
                        else
                        {
                            if (elapsed_time > 30f)
                            {
                                start_replay = true;
                                replay_mode_ = true;
                            }
                        }
                        if (start_replay)
                        {
                            exit_title = true;
                            SystemManager.Instance.setSubjective(false);
                            replay_manager_.startPlaying(update_time_, Player.Instance);
                        }
                    }
                }
                if (exit_title)
                {
                    game_phase_ = GamePhase.Game;
                    SystemManager.Instance.registSound(DrawBuffer.SE.Missile);
                    SystemManager.Instance.registMotion(DrawBuffer.Motion.GoodLuck);
                }
                yield return(null);
            }
            notice.destroy();
            MyRandom.setSeed(123456789u);

            for (var w = new Utility.WaitForSeconds(1.5f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Player.Instance.setPhaseStart();
            SystemManager.Instance.registBgm(DrawBuffer.BGM.Battle);
            for (var w = new Utility.WaitForSeconds(4f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Notice.create(0f, 0f,
                          update_time_ + 3f,
                          MySprite.Kind.GamePadPress,
                          MySprite.Type.Full,
                          true /* blink */);
            for (var w = new Utility.WaitForSeconds(1f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }

            Player.Instance.setPhaseBattle();
            SystemManager.Instance.setFlowSpeed(-100f);
            while (TubeScroller.Instance.getDistance() < 100f)
            {
                yield return(null);
            }

            for (var j = 0; j < 4; ++j)
            {
                for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
                for (var i = 0; i < 4; ++i)
                {
                    for (var w = new Utility.WaitForSeconds(0.5f, update_time_); !w.end(update_time_);)
                    {
                        yield return(null);
                    }
                    Enemy.create(Enemy.Type.Zako2);
                }

                if (j == 1)
                {
                    Notice.create(-200f, 200f,
                                  update_time_ + 3f,
                                  MySprite.Kind.GamePadRelease,
                                  MySprite.Type.Full,
                                  true /* blink */);
                }
            }

            while (TubeScroller.Instance.getDistance() < 2400f)
            {
                yield return(null);
            }

            Enemy dragon = Enemy.create(Enemy.Type.Dragon);

            SystemManager.Instance.setFlowSpeed(-10f);

            while (TubeScroller.Instance.getDistance() < 2800f)
            {
                for (var w = new Utility.WaitForSeconds(5f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
                for (var j = new Utility.WaitForSeconds(2f, update_time_); !j.end(update_time_);)
                {
                    yield return(null);

                    Enemy.create(Enemy.Type.Zako2);
                    for (var w = new Utility.WaitForSeconds(0.25f, update_time_); !w.end(update_time_);)
                    {
                        yield return(null);
                    }
                }
                yield return(null);
            }

            float flow_speed = 150f;

            SystemManager.Instance.setFlowSpeed(-150f);
            dragon.setMode(Dragon.Mode.Chase);

            for (var i = 0; i < 4; ++i)
            {
                for (var v = new Utility.WaitForSeconds(3f, update_time_); !v.end(update_time_);)
                {
                    Enemy.create(Enemy.Type.Zako2);
                    for (var w = new Utility.WaitForSeconds(0.5f, update_time_); !w.end(update_time_);)
                    {
                        yield return(null);
                    }
                }
                for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
            }

            for (var w = new Utility.WaitForSeconds(2f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            dragon.setMode(Dragon.Mode.Farewell);
            for (var i = 0; i < 16; ++i)
            {
                float rot = 30f * i;
                Shutter.create(rot, flow_speed, update_time_);
                Shutter.create(rot + 180f, flow_speed, update_time_);
                for (var w = new Utility.WaitForSeconds(1f, update_time_); !w.end(update_time_);)
                {
                    yield return(null);
                }
            }
            while (TubeScroller.Instance.getDistance() < 9400f)
            {
                yield return(null);
            }

            dragon.setMode(Dragon.Mode.LastAttack);
            for (var w = new Utility.WaitForSeconds(11f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }
            Notice.create(0f, 0f,
                          update_time_ + 6f,
                          MySprite.Kind.Logo,
                          MySprite.Type.Full,
                          false);
            for (var w = new Utility.WaitForSeconds(5f, update_time_); !w.end(update_time_);)
            {
                yield return(null);
            }

            SystemManager.Instance.restart();
        }