private void Move(int x, int y) { if (_proceduralBoard.IsWalkableTile(x, y) && !_proceduralBoard.HasEnemy(x, y)) { _movement.Move(x, y); } }
private bool MakeAction(int x, int y) { bool makeAction = false; if (!_proceduralBoard.HasEnemy(x, y)) { if (_proceduralBoard.IsWalkableTile(x, y)) { _movement.Move(x, y); LostFood(_walkFood); makeAction = true; } else if (_proceduralBoard.IsBreakableTile(x, y)) { _breaker.BreakTile(x, y); _anim.SetTrigger("Chop"); LostFood(_brokeWallFood); makeAction = true; } } return(makeAction); }