示例#1
0
        public override void Update()
        {
            base.Update();

            PhysicsManager.Update();
            UpdateManager.Update();
            PhysicsManager.CheckCollisions();
            BombsManager.Update();

            //enemyCount in class Enemy is better
            if (Enemy.EnemyCount <= 0)
            {
                machine.Switch((int)GameManager.GameState.Win);
            }
            else if (PlayScene.AreDeadAllPlayers())
            {
                machine.Switch((int)GameManager.GameState.Lose);
            }

            if (startLabel.IsActive)
            {
                if (timeToDeactiveStartLabel <= 0)
                {
                    startLabel.IsActive = false;
                }
                else
                {
                    timeToDeactiveStartLabel -= Game.DeltaTime;
                }
            }
        }
示例#2
0
        public override void Update()
        {
            base.Update();

            float shake = (float)Math.Sin(shakeCounter) * WIDTH_SHAKE;

            labelWin.GetSprite().scale += new Vector2(shake) * Game.DeltaTime;
            shakeCounter += Game.DeltaTime * SPEED_SHAKE_MULTIPLIER;

            PhysicsManager.Update();
            UpdateManager.Update();
            BombsManager.Update();
        }