Пример #1
0
            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);
            }
Пример #2
0
 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();
     }
 }
Пример #3
0
 public static void RespawnedSpaceship(Spaceship.Mutable spaceship)
 {
     instance.respawnEffectsPool.Borrow <IPoolable>(spaceship.Position);
 }
Пример #4
0
 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);
 }
Пример #5
0
 public static void RespawnedSpaceship(Spaceship.Mutable spaceship)
 {
     Space.spaceships.Add(spaceship.obj);
 }
Пример #6
0
 /// <summary>
 /// Only removes the spaceship from the list of active spaceships.
 /// </summary>
 public void RemoveSpaceship(Spaceship.Mutable spaceship)
 {
     Space.spaceships.Remove(spaceship.obj);
 }
Пример #7
0
 private void SpaceshipKilled(Spaceship.Mutable spaceship)
 {
     scoreBoard.AddScore(spaceship.Name, -1);
     spaceship.BeDead();
     instance.explosionEffectsPool.Borrow <IPoolable>(spaceship.Position);
 }
Пример #8
0
 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);
 }
Пример #9
0
 private void Reset(Spaceship.Mutable shooter)
 {
     turnsToLive  = TURNS_TO_LIVE;
     this.shooter = shooter;
 }