示例#1
0
        public void Initialize()
        {
            isEndFlag              = false;
            StageState.stageStage  = 1;
            StageState.sceneNumber = 2;
            gameObjectManager.Initialize();
            map2 = new Map2(GameDevice.Instance());
            if (StageState.worldsStage <= 2)
            {
                map2.Load("StageSelect1.csv", "./csv/");
            }
            else
            {
                map2.Load("StageSelect2.csv", "./csv/");
            }
            gameObjectManager.Add(map2);
            sound.PlayBGM("WorldSelect");

            //最初に回っている
            player = new Player(new Vector2(96 * 2 + 15, 96 * 6 + 15), GameDevice.Instance(), gameObjectManager, 0.1f);
            gameObjectManager.Add(player);


            //最初に止まっている
            player2 = new Player2(new Vector2(96 * 1 + 15, 96 * 6 + 15), GameDevice.Instance(), gameObjectManager, player.AddRadian());
            gameObjectManager.Add(player2);
            player.SetPos(player2.GetPosition());
            camera.SetPosition(new Vector2(Screen.Width / 2 - 48, Screen.Height / 2));
            cameraPos       = player2.GetPosition();
            cameraDirection = CameraDirection.IDLE;

            motion.Add(0, new Rectangle(500 * 0, 500 * 0, 500, 500));
            motion.Add(1, new Rectangle(500 * 1, 500 * 0, 500, 500));
            motion.Add(2, new Rectangle(500 * 2, 500 * 0, 500, 500));
            motion.Add(3, new Rectangle(500 * 3, 500 * 0, 500, 500));
            motion.Add(4, new Rectangle(500 * 0, 500 * 1, 500, 500));
            motion.Add(5, new Rectangle(500 * 1, 500 * 1, 500, 500));
            motion.Add(6, new Rectangle(500 * 2, 500 * 1, 500, 500));
            motion.Add(7, new Rectangle(500 * 3, 500 * 1, 500, 500));
            motion.Add(8, new Rectangle(500 * 2, 500 * 1, 500, 500));
            motion.Add(9, new Rectangle(500 * 1, 500 * 1, 500, 500));
            motion.Add(10, new Rectangle(500 * 0, 500 * 1, 500, 500));
            motion.Add(11, new Rectangle(500 * 3, 500 * 0, 500, 500));
            motion.Add(12, new Rectangle(500 * 2, 500 * 0, 500, 500));
            motion.Add(13, new Rectangle(500 * 1, 500 * 0, 500, 500));

            motion.Initialize(new Range(0, 13), new CountDownTimer(0.1f));

            motion2.Add(0, new Rectangle(64 * 0, 64 * 0, 64, 64));
            motion2.Add(1, new Rectangle(64 * 1, 64 * 0, 64, 64));
            motion2.Add(2, new Rectangle(64 * 0, 64 * 1, 64, 64));
            motion2.Add(3, new Rectangle(64 * 1, 64 * 1, 64, 64));
            motion2.Initialize(new Range(0, 3), new CountDownTimer(0.1f));
        }
示例#2
0
        public void Initialize()
        {
            StageState.isClear     = false;
            StageState.isMusic     = false;
            StageState.sceneNumber = 3;
            isEndFlag = false;
            playNow   = false;
            isstart   = false;
            _end      = false;
            safe      = false;
            cnt       = 0;
            alpha     = 0;
            end       = 0;
            gameObjectManager.Initialize();
            firstpositions = new List <int>()
            {
                5, 5, 7, 6, 6, 5, 13, 7, 10, 24, 5, 14, 5, 11, 14
            };
            map2 = new Map2(GameDevice.Instance());

            map2.Load(StageState.worldsStage + "-" + StageState.stageStage + ".csv", "./csv/");
            gameObjectManager.Add(map2);

            if (StageState.worldsStage == 2 || (StageState.worldsStage == 1 && StageState.stageStage == 5))
            {
                bpm       = 150;
                addradian = 0.125f;
                motionbpm = 0.4f;
            }
            else
            {
                bpm       = 120;
                addradian = 0.1f;
                motionbpm = 0.5f;
            }

            positions = new int[, ]
            {
                { 5, 5, 7, 6, 6 },
                { 5, 13, 7, 10, 24 },
                { 5, 4, 5, 11, 14 },
            };
            for (int i = 1; i <= 3; i++)
            {
                for (int j = 1; j <= 5; j++)
                {
                    if (StageState.worldsStage == i)
                    {
                        if (StageState.stageStage == j)
                        {
                            playerposition = new Vector2(96 * 5 + 16, 96 * positions[i - 1, j - 1] + 16);
                        }
                    }
                }
            }

            player       = new Player(new Vector2(playerposition.X + 96, playerposition.Y), GameDevice.Instance(), gameObjectManager, addradian);
            player.stop  = true;
            player.alpha = 1;
            gameObjectManager.Add(player);

            //最初に止まっている
            player2 = new Player2(playerposition, GameDevice.Instance(), gameObjectManager, player.AddRadian());
            gameObjectManager.Add(player2);
            camera.SetPosition(player2.GetPosition());
            cameraPos       = player2.GetPosition();
            cameraDirection = CameraDirection.IDLE;



            player.SetPos(player2.GetPosition());
            metoronome.Initialize();
            metoronome.SetBpm(bpm);
            motion = new Motion();
            motion.Add(0, new Rectangle(200 * 0, 200 * 0, 200, 200));
            motion.Add(1, new Rectangle(200 * 1, 200 * 0, 200, 200));
            motion.Add(2, new Rectangle(200 * 0, 200 * 1, 200, 200));
            motion.Add(3, new Rectangle(200 * 1, 200 * 1, 200, 200));
            motion.Add(4, new Rectangle(1, 1, 1, 1));
            motion.Add(5, new Rectangle(1, 1, 1, 1));
            motion.Initialize(new Range(4, 5), new CountDownTimer(motionbpm));
            startmotion  = StartMotion.NULL;
            startmotions = new Dictionary <StartMotion, Range>()
            {
                { StartMotion.START, new Range(0, 3) },
                { StartMotion.NULL, new Range(4, 5) },
            };
            isp = false;

            startcnt  = 0;
            cameracnt = 0;
            a         = 60;

            motion2 = new Motion();
            motion2.Add(0, new Rectangle(0, 0, 800, 400));
            motion2.Add(1, new Rectangle(0, 0, 800, 400));
            motion2.Add(2, new Rectangle(0, 0, 1, 1));
            motion2.Add(3, new Rectangle(0, 0, 1, 1));
            motion2.Initialize(new Range(2, 3), new CountDownTimer(0.5f));
            clearmotion  = ClearMotion.NULL;
            clearmotions = new Dictionary <ClearMotion, Range>()
            {
                { ClearMotion.CLEAR, new Range(0, 1) },
                { ClearMotion.NULL, new Range(2, 3) },
            };
        }