public void Kill()
        {
            PlayerStatus.RemoveLife();
            framesUntilRespawn = PlayerStatus.IsGameOver ? 300 : 120;

            Color explosionColor = new Color(0.8f, 0.8f, 0.4f);                 // yellow

            for (int i = 0; i < 1200; i++)
            {
                float speed = 18f * (1f - 1 / rand.NextFloat(1f, 10f));
                Color color = Color.Lerp(Color.White, explosionColor, rand.NextFloat(0, 1));
                var   state = new ParticleState()
                {
                    Velocity         = rand.NextVector2(speed, speed),
                    Type             = ParticleType.None,
                    LengthMultiplier = 1
                };

                NeonShooterGame.ParticleManager.CreateParticle(Art.LineParticle, Position, color, 190, 1.5f, state);
            }
        }
Esempio n. 2
0
        public void Kill()
        {
            EntityManager.Reset();
            EnemySpawner.Reset();
            //framesUntilRespawn = 60;
            PlayerStatus.RemoveLife();
            PlayerStatus.ResetMultiplier();
            if (PlayerStatus.Lives == 0)
            {
                PlayerStatus.GameOver();
                GameManager.PauseGame(300, true);
            }
            framesUntilRespawn = PlayerStatus.IsGameOver ? 300 : 120;
            var yellow = new Color(0.8f, 0.8f, 0.4f);

            for (var i = 0; i < 1200; i++)
            {
                var speed         = 18f * (1f - 1 / rand.NextFloat(1f, 10f));
                var particleColor = Color.Lerp(Color.White, yellow, rand.NextFloat(0, 1));
                var state         = new ParticleState(rand.NextVector2(speed, speed), ParticleType.None);

                GameRoot.ParticleManager.CreateParticle(Art.LineParticle, Position, particleColor, 60, new Vector2(0.7f, 0.7f), state);
            }
        }