private void Food_OnPlayerPickUp(PickedUpArgs e) { e.Player.Heal(_healAmount); _pickUpSound.Play(); }
private void Gem_OnPlayerPickUp(PickedUpArgs e) { e.Player.Score += GetValue(); GameWorld.ParticleSystem.Add(new SplashNumber(this, GetValue(), Color.Yellow)); }
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); } }