Beispiel #1
0
        public void Initialize()
        {
            isEndFlag = false;
            StageState.sceneNumber = 1;
            gameObjectManager.Initialize();

            map = new Map(GameDevice.Instance());
            map.Load("Title.csv", "./csv/");
            gameObjectManager.Add(map);

            //最初に回っている
            player3 = new Player3(new Vector2(128 * 6 + 15, 128 * 5 + 15), GameDevice.Instance(), gameObjectManager);
            gameObjectManager.Add(player3);

            //最初に止まっている
            player4 = new Player4(new Vector2(128 * 7 + 18, 128 * 5 + 18), GameDevice.Instance(), gameObjectManager);
            gameObjectManager.Add(player4);

            player3.SetPos(player4.GetPosition());

            stop3 = player3.IsStop();
            stop4 = player4.IsStop();

            metoronome.Initialize();
            metoronome.SetBpm(60);

            motion.Add(0, new Rectangle(64 * 0, 64 * 0, 64, 64));
            motion.Add(1, new Rectangle(64 * 1, 64 * 0, 64, 64));
            motion.Add(2, new Rectangle(64 * 0, 64 * 1, 64, 64));
            motion.Add(3, new Rectangle(64 * 1, 64 * 1, 64, 64));
            motion.Initialize(new Range(0, 3), new CountDownTimer(0.1f));
        }
Beispiel #2
0
        public void Update(GameTime gameTime)
        {
            motion.Update(gameTime);
            metoronome.Update(gameTime);
            map.Update(gameTime);
            sound.PlayBGM("Title");
            gameObjectManager.Update(gameTime);

            float delta = (float)gameTime.ElapsedGameTime.TotalSeconds;

            particleManager.Update(delta);
            if (particleManager.IsCount(30))
            {
                particleManager.TitleParticle("title", new Vector2(Screen.Width / 2, 200));
            }

            if (player3.IsHit())
            {
                if (!player3.IsStop())
                {
                    player3.SetPosition2(player4.GetPosition());
                    //if (player3.IsPush())
                    //{
                    //    stop4 = false;
                    //    player4.stop = stop4;
                    //}
                }
                else
                {
                    player3.SetPosition2(player4.GetPosition());
                }
            }
            if (player4.IsHit())
            {
                if (!player4.IsStop())
                {
                    player4.SetPosition2(player3.GetPosition());
                    //if (player4.IsPush())
                    //{
                    //    stop3 = false;
                    //    player3.stop = stop3;
                    //}
                }
                else
                {
                    player4.SetPosition2(player3.GetPosition());
                }
            }

            if (!player3.IsStop() && !player4.IsStop())
            {
                player3.SetPosition(new Vector2(128 * 6 + 15, 128 * 5 + 15));
                player4.SetPosition(new Vector2(128 * 7 + 18, 128 * 5 + 18));
                player4.stop = true;
                player3.stop = false;
            }

            if (Input.GetKeyState(Keys.Right))
            {
                camera.Move(1, 0);
            }
            if (Input.GetKeyState(Keys.Left))
            {
                camera.Move(-1, 0);
            }
            if (Input.GetKeyState(Keys.Up))
            {
                camera.Move(0, -1);
            }
            if (Input.GetKeyState(Keys.Down))
            {
                camera.Move(0, 1);
            }
            if (player3.IsDead() || player4.IsDead())
            {
                isEndFlag = true;
            }
        }