Take damage from bullets

This commit is contained in:
2021-04-19 23:43:23 +02:00
parent d69c05db1f
commit 85707b2619
2 changed files with 10 additions and 0 deletions
+10
View File
@@ -219,5 +219,15 @@ namespace EvilSatellites.Objects
{
sfxTaps.Play();
}
override public void OnCollision(IGameObject obj)
{
if (obj.Type == ObjectType.Projectile)
{
var proj = (Projectile)obj;
if (proj.Owner == this) return;
TakeDamage(rnd.Next(20));
}
}
}
}