public override void Collision(Actor other) { PlayerShip ship = other as PlayerShip; if (ship != null) { dead = true; action(ship); } }
public virtual void Collision(Actor other) { }
public override void OnHit(Actor other) { Bullet bullet = other as Bullet; if (bullet == null || bullet.Dead) return; bullet.Die(); hitPoints--; if (hitPoints <= 0) { self.Die(); } if (bullet is PrismBullet) { Vector2 v = bullet.Velocity; Vector2 vn = v; vn.Normalize(); PrismBullet a = new PrismBullet(bullet.Position + new Vector2(vn.X, vn.Y), new Vector2(v.X, v.Y), bullet.Color); PrismBullet b = new PrismBullet(bullet.Position + new Vector2(-vn.Y, vn.X), new Vector2(-v.Y, v.X), bullet.Color); PrismBullet c = new PrismBullet(bullet.Position + new Vector2(vn.Y, -vn.X), new Vector2(v.Y, -v.X), bullet.Color); PrismBullet d = new PrismBullet(bullet.Position + new Vector2(-vn.X, -vn.Y), new Vector2(-v.X, -v.Y), bullet.Color); Util.Actors.Add(a); Util.Actors.Add(b); Util.Actors.Add(c); Util.Actors.Add(d); } }
public override void OnHit(Actor other) { Bullet bullet = other as Bullet; if (bullet == null || bullet.Dead) return; bullet.Die(); self.Die(); }
public override void OnHit(Actor other) { Enemy enemy = other as Enemy; if (enemy != null && enemy.Damage is MineDamage) return; self.Die(); }
public abstract void OnHit(Actor other);
public override void Collision(Actor other) { Bullet b = other as Bullet; if (b != null) { b.Die(); if (Util.MODE == Util.Mode.TwoPlayer) { Util.GetPlayer(Util.OtherPlayer(player)).Equip("Empty", 1); } } Enemy e = other as Enemy; if (e != null && e.fadeIn <= 0) { if (immunity > 0) e.Die(); else { Die(); Util.Actors.Add(new ProxyEnemy(e)); } } }