public override void OnCollide(CollidableGameComponent otherObject, Vector2 offsetMeToOther) { if (otherObject is Monkey) { GameHM.CurrentTheme.SoundMissile.Play(); // Coconut is converted into a missile when hit Vector2 dir = -1.0f * offsetMeToOther; dir.Normalize(); CoconutMissile coconut = new CoconutMissile(Position, dir, ((Monkey)otherObject).PlayerNumber); GameHM.Components.Add(coconut); this.Dispose(); } }
public virtual void OnCollide(CollidableGameComponent otherObject, Vector2 offsetMeToOther) { }