public override void resolveCollision(CommandCenter collider) { if (boxCollider.Intersects(collider.boxCollider)) { if (Player != collider) { collider.Hit(); Player._currentActive = null; isAlive = false; } } }
public override void resolveCollision(CommandCenter collider) { if (boxCollider.Intersects(collider.boxCollider)) { if (Player != collider) { collider.Hit(); Player._currentActive = null; isAlive = false; GameScreen.particleSystem.AddExplosion(_position); } } }
public void resolveCollision(CommandCenter collider) { if (!isAlive) { return; } float distance = (_position - collider.Position).Length(); if (!(distance < radius + collider.radius)) { return; } collider.Hit(); GameScreen.deadAsteroids.Enqueue(this); isAlive = false; GameScreen.currentNumAsteroids--; }