I improved the unit attack code to use path finding to direct the unit towards the target.
Moving a unit towards a target for attacking is different than just moving the unit to a specific location. The target may be moving. The requirements are:
- An attacker requires to track its target tightly.
- The attacker should make use of path finding sparingly.
- A target should not be able to outfox an attacker by doing smart maneuvers around obstructions
The improved implementation adheres to these requirements. The attacker has two states:
- Tracking the target closely (moving directly towards the position of the target)
- Following a path
Now onto some more features!
No comments:
Post a Comment