Beispiel #1
0
 private void ChangeMotion(StartMotion startmotion)
 {
     this.startmotion = startmotion;
     motion.Initialize(startmotions[startmotion],
                       new CountDownTimer(motionbpm));
 }
Beispiel #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) },
            };
        }