Пример #1
0
 private void Food_OnPlayerPickUp(PickedUpArgs e)
 {
     e.Player.Heal(_healAmount);
     _pickUpSound.Play();
 }
Пример #2
0
        private void Gem_OnPlayerPickUp(PickedUpArgs e)
        {
            e.Player.Score += GetValue();

            GameWorld.ParticleSystem.Add(new SplashNumber(this, GetValue(), Color.Yellow));
        }
Пример #3
0
 private void SpawnSparkles(PickedUpArgs e)
 {
     for (int i = 0; i < 2; i++)
     {
         float randY = (float)(GameWorld.RandGen.Next(-1, 0) * GameWorld.RandGen.NextDouble());
         float randX = (float)(GameWorld.RandGen.Next(-1, 2) * GameWorld.RandGen.NextDouble());
         RoundCommonParticle par = new RoundCommonParticle(CollRectangle.Center.X, CollRectangle.Center.Y, new Vector2(randX,randY), Color.Yellow);
         GameWorld.ParticleSystem.Add(par);
     }
 }