Closed Oleksii-Kshenskyi closed 7 months ago
This is also blocked by the #10 line of sight mechanics implementation because to determine if its looking at another player to then choose to flee, the player needs to have a line of sight. As of right now, the only tile a player "sees" is the immediate tile they're looking at.
This ability to move two tiles backwards kind of breaks the consistency of only being able to walk where player's looking, therefore in the future, when the simulation evolves, look into these possibilities:
For now though, for ease of implementation and to quickly move on to genetics, implement "disengage" as moving backwards 2 tiles in a single turn.
NOTE: there is a minor bug in this implementation because of a conflict with color blinking on line of sight detection where if a player dies in the same turn as it changes color due to line of sight, it will return to its old "alive" red color instead of the correct black to indicate that it's dead. This is not a big issue because in the future color blinking is going to be replaced with using line of sight detection properly, so the issue is temporary and therefore is not worth fixing.
Back off jump/disengage action means that a player who sees another player in its line of sight has to be able to choose an option to "flight" (it's a part of a basic fight or flight response).
The action is implemented by letting a player jump two tiles backwards (opposite of the direction it's facing) in the case if they're seeing another player in their immediate vicinity and choose to "flight".
As of right now, players can only move in the direction they're facing, so this may be a bit difficult to implement.