public override void Die()
 {
     Player.Points += pointValue;
     if (LevelManager.Current.UIStats.PowerShown)
     {
         if (pointValue != 0)
         {
             UIEffect e = new UIEffect(position, RandUnitVector2(), 0.1f, "+" + pointValue.ToString(), Color.Turquoise, 0.9f);
             UILayer.AddUIEffect(e);
         }
     }
     NormalMap.AddBlast2(position, Size / 20, Size / 8);
 }
Beispiel #2
0
        //Adds effects to the UI appropriate to the current scores
        private static void AddUIParticles()
        {
            if (Multiplier > 1)
            {
                VertexBag v = new VertexBag(UIPositions.Multiplier + UIPositions.MultiplierOffset, Color.White, Color.Yellow, 1, (int)((Multiplier / 5) * 50), (int)Multiplier + 4);
                UILayer.AddParticleEffect(v);
            }

            if (Points > 0)
            {
                VertexBag v = new VertexBag(UIPositions.Power + UIPositions.PowerOffset, Color.CadetBlue, Color.Cyan, 1, (int)((float)(Points / (float)stats.MaxPower) * 80), (int)((float)Points / (float)stats.MaxPower) * 5 + 3);
                UILayer.AddParticleEffect(v);
            }
        }
Beispiel #3
0
        protected override void LoadContent()
        {
            LevelManager.Assemble();
            CollisionGrid.Assemble();

            spriteBatch   = new SpriteBatch(GraphicsDevice);
            rand          = new Random();
            player        = new Player(this);
            eManager      = new EnemyManager(this);
            uILayer       = new UILayer(this, spriteBatch);
            shaderWrapper = new ShaderWrapper(this);
            counter       = new ForceCounter(this);

            ShaderWrapper.ClearBG(Color.SteelBlue);
        }
        public virtual void Die()
        {
            Player.Points += pointValue;
            float pointsToAdd = (float)pointValue * Player.Multiplier;

            Player.Score += pointsToAdd;

            float txtScale = 0.9f;
            float grav     = 0.1f;

            if (pointsToAdd > 100)
            {
                txtScale = 1.5f;
                grav     = 0.04f;
            }
            if (LevelManager.Current.UIStats.PowerShown)
            {
                if (pointValue != 0)
                {
                    UIEffect e = new UIEffect(position, RandUnitVector2(), 0.1f, "+" + pointValue.ToString(), Color.Turquoise, 0.9f);
                    UILayer.AddUIEffect(e);
                }
            }
            if (pointValue != 0)
            {
                VertexBag v = new VertexBag(UIPositions.Score + UIPositions.ScoreOffset, Color.GreenYellow,
                                            Color.LawnGreen, 1, Math.Min((int)(50 * pointsToAdd), 1000), 10);
                UILayer.AddParticleEffect(v);
                UIEffect b = new UIEffect(position, RandUnitVector2(),
                                          grav, "+" + Math.Round(pointsToAdd, 1).ToString(),
                                          Color.Yellow, txtScale);

                UILayer.AddUIEffect(b);
            }
            NormalMap.AddBlast2(position, Size / 10, Size / 8);
        }
        public static void NextLevel(bool advance)
        {
            if (advance)
            {
                currentLevel++;
            }

            if (currentLevel < 19)
            {
                switch (Mode)
                {
                case GameMode.Normal:
                    Current = Levels[currentLevel];
                    break;

                case GameMode.Worms:
                    Current = WormLevels[currentLevel];
                    break;

                case GameMode.Moving:
                    Current = Levels[Levels.Count - 1];
                    break;

                case GameMode.Chaos:
                    Current = Levels[Levels.Count - 1];
                    break;
                }
                Player.NextLevel();
                UILayer.NextLevel();
                EnemyManager.NextLevel();
            }
            else
            {
                Player.StartFinalTimer();
            }
        }