Beispiel #1
0
        private void explode()
        {
            GameBoard.explodeBomb(pos);
            explodeInDir(1, 0);
            explodeInDir(0, 1);
            explodeInDir(-1, 0);
            explodeInDir(0, -1);
            square.setState(SquareState.Empty);
            BombermanGameStateUpdater.addNewAction(new BoardAction(ActionType.BombExplosion, ID, null));
            BombermanGameStateUpdater.removeObj(this as BombermanMapObject);

            if (owner != null)
            {
                owner.placedBombExplode();
            }
            Destroy(gameObject);
        }
        public void placeBomb()
        {
            if (GameBoard.validCoord(currentCoord [0], currentCoord [1]) == false)
            {
                return;
            }
            if (bombsLeft == 0)
            {
                return;
            }

            Bomb temp = Instantiate(bombPrefab, GameBoard.getGridPos(currentCoord [0], currentCoord [1]), Quaternion.identity, transform.parent).GetComponent <Bomb> ();

            temp.init(3, 3, currentCoord, this);

            BoardAction dropAction = new BoardAction(ActionType.BombSpawn, temp.ID, BombermanOverlord.vecToFlArray(temp.transform.localPosition));

            BombermanGameStateUpdater.addNewAction(dropAction);
            bombsLeft--;
        }
 public static void playerDied(PlayerController p)
 {
     singleton.players.Remove(p);
     BombermanGameStateUpdater.addNewAction(new BoardAction(ActionType.PlayerDeath, p.ID, p.getFloatPos()));
     BombermanGameStateUpdater.removeObj(p as BombermanMapObject);
 }