-
Notifications
You must be signed in to change notification settings - Fork 0
Enemy Movement
quocdat402 edited this page Oct 16, 2022
·
3 revisions
The enemy units roam freely within the city square. Roaming occurs where an enemy unit randomly selects a gridpoint within the city centre and moves towards the selected point. A timer is implemented to change the destination of the enemy unit at random intervals. A MovementTask object is created when a destination has been selected.
public GridPoint2 randomlySelectTileToMoveTo() {
int height = this.mapGenerator.getHeight();
ArrayList<int[]> legalMoves = this.mapGenerator.getLegalCoordinates();
int size = legalMoves.size();
int randomSeed = PseudoRandom.seedRandomInt(0, size);
int[] coords = legalMoves.get(randomSeed);
return new GridPoint2(coords[1], height - coords[0]);
}
A timer is implemented that randomly selects an interval between 5 and 10 seconds. Once the timer has expired, a new grid point is chosen for the enemy unit to go to.
Map
City
Buildings
Unit Selections
Game User Testing: Theme of Unit Selection & Spell System
Health Bars
In Game menu
- Feature
- User Testing:In Game Menu
Landscape Tile Design Feedback