Update() 공개 정적인 메소드

すべてのMoverの行動を実行する
public static Update ( ) : void
리턴 void
예제 #1
0
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }
            timer++;
            if (timer > 60)
            {
                timer = 0;
                if (mover.used == false)
                {
                    //敵を一つ画面中央に作成し、弾を吐くよう設定
                    mover     = MoverManager.CreateMover();
                    mover.pos = new Vector2(graphics.PreferredBackBufferWidth / 4 + graphics.PreferredBackBufferWidth / 2 * (float)rand.NextDouble(), graphics.PreferredBackBufferHeight / 2 * (float)rand.NextDouble());
                    mover.SetBullet(parser.tree); //BulletMLで動かすように設定
                }
            }

            //すべてのMoverを行動させる
            MoverManager.Update();
            //使わなくなったMoverを解放
            MoverManager.FreeMovers();
            // 自機を更新
            myship.Update();

            base.Update(gameTime);
        }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            ////update the timer
            //_clock.Update(gameTime);

            ////update the input
            //_inputState.Update();
            //_inputWrapper.Update(_inputState, false);

            ////check input to increment/decrement the current bullet pattern
            //if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.LShoulder))
            //{
            //	//decrement the pattern
            //	if (0 >= _CurrentPattern)
            //	{
            //		//if it is at the beginning, move to the end
            //		_CurrentPattern = _myPatterns.Count - 1;
            //	}
            //	else
            //	{
            //		_CurrentPattern--;
            //	}

            //	AddBullet();
            //}
            //else if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.RShoulder))
            //{
            //	//increment the pattern
            //	if ((_myPatterns.Count - 1) <= _CurrentPattern)
            //	{
            //		//if it is at the beginning, move to the end
            //		_CurrentPattern = 0;
            //	}
            //	else
            //	{
            //		_CurrentPattern++;
            //	}

            //	AddBullet();
            //}

            ////reset the bullet pattern
            //if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.A))
            //{
            //	AddBullet();
            //}

            ////increase/decrease the rank
            //if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.LShoulder))
            //{
            //	if (_Rank > 0.0f)
            //	{
            //		_Rank -= 0.1f;
            //	}

            //	if (_Rank < 0.0f)
            //	{
            //		_Rank = 0.0f;
            //	}
            //}
            //else if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.RShoulder))
            //{
            //	if (_Rank < 1.0f)
            //	{
            //		_Rank += 0.1f;
            //	}

            //	if (_Rank > 1.0f)
            //	{
            //		_Rank = 1.0f;
            //	}
            //}

            ////if y is held down, do some slowdown
            //if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.Y))
            //{
            //	_moverManager.TimeSpeed = 0.5f;
            //}
            //else
            //{
            //	_moverManager.TimeSpeed = 1.0f;
            //}

            ////if b is held down, make it bigger
            //if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.LTrigger))
            //{
            //	_moverManager.Scale -= 0.1f;
            //}
            //else if (_inputWrapper.Controller.CheckKeystroke(EKeystroke.RTrigger))
            //{
            //	_moverManager.Scale += 0.1f;
            //}

            _moverManager.Update();

            myship.Update();

            base.Update(gameTime);
        }