public void RegisterShot(ShotBody body, Spaceship.Mutable shooter) { var shot = Space.shotsPool.Borrow(); var shotMutable = Space.shotMutablesPool.Borrow(); shotMutable.Activate(shot, body, shooter); Space.shots.Add(shot); Space.shotMutables.Add(shotMutable); }
private void SpaceshipKilled(Spaceship.Mutable spaceship) { scoreBoard.AddScore(spaceship.Name, DEATH_SCORE_PENALTY); spaceship.BeDead(); instance.explosionEffectsPool.Borrow <IPoolable>(spaceship.Position); ++deaths; if (deaths == space.Spaceships.Count * deathsPerShip) { Debug.Break(); } }
public static void RespawnedSpaceship(Spaceship.Mutable spaceship) { instance.respawnEffectsPool.Borrow <IPoolable>(spaceship.Position); }
public static void SpawnShot(Spaceship.Mutable shooter) { instance.shotBodiesPool.Borrow <ShotBody>(shooter.Position, shooter.Rotation, instance.space, shooter); AudioManager.PlayClip(spaceshipImages[shooter.Brain.BodyType].shotSound); }
public static void RespawnedSpaceship(Spaceship.Mutable spaceship) { Space.spaceships.Add(spaceship.obj); }
/// <summary> /// Only removes the spaceship from the list of active spaceships. /// </summary> public void RemoveSpaceship(Spaceship.Mutable spaceship) { Space.spaceships.Remove(spaceship.obj); }
private void SpaceshipKilled(Spaceship.Mutable spaceship) { scoreBoard.AddScore(spaceship.Name, -1); spaceship.BeDead(); instance.explosionEffectsPool.Borrow <IPoolable>(spaceship.Position); }
public void Activate(Shot obj, Body body, Spaceship.Mutable shooter) { base.Activate(obj, body); this.obj.Reset(shooter); obj.body.MoveForward(SPEED_PER_TURN * 2); }
private void Reset(Spaceship.Mutable shooter) { turnsToLive = TURNS_TO_LIVE; this.shooter = shooter; }