예제 #1
0
        public override void handleTurn()
        {
            // find ally ship.
              target = mc.getAllyShip();

              // chase target and fire.
              moveToTarget(target.Point);
        }
예제 #2
0
 // Mark the turn over for that ship.
 public void turnOver(GenericShip ship)
 {
     if (Object.ReferenceEquals (ship, enemy)) {
       playerTurn = true;
     } else {
       playerTurn = false;
       enemy.handleTurn ();
     }
 }
예제 #3
0
 protected void fireAt(GenericShip enemy)
 {
     int distance = Point.DistanceFrom (enemy.Point);
       GameObject bomb = GameObject.Instantiate (AssetManager.Instance.bombPrefab,
                   Position, Quaternion.identity) as GameObject;
       bomb.transform.DOMove (mc.Map [enemy.Point], distance * 0.4f, false)
     .OnComplete (() => {
     GameObject.Destroy (bomb);
     endTurn ();
       });
 }
예제 #4
0
    private void PlaceShip()
    {
        ship = new Ship (ShipType.CARRACK);
        ship.instantiate (PointyHexPoint.Zero);

        enemy = new AutomatedShip (ShipType.GALLEY);
        enemy.instantiate (PointyHexPoint.East * 4);
    }