In the original percy vs grog script, Grog would just run towards Percy at max speed, and would always start at a higher position value than Percy; the movement functions were written with this into account.
This means:
melee attackers will only move if they have a higher 'position' than the target
melee attackers make melee attacks from range if their position is 'lower' than the target
This is all borked up. Needs to be replaced with a proper co-ordinate system;
define x,y co-ordinates for creature
define minimum and maximum x,y values for a 'map'
initialise_position should define both x,y co-ordinates for target
each co-ordinate should correspond to a 5x5 grid to make determining spell/creature effects easier in the future
get_distance and other distance comparison functions should compute the shortest number of 5x5 grids between two points (allow diagonal movement/attack)
Also needs to have flexibility for a z co-ordinate in the future (to allow for flying/climbing enemies)
In the original percy vs grog script, Grog would just run towards Percy at max speed, and would always start at a higher position value than Percy; the movement functions were written with this into account.
This means:
This is all borked up. Needs to be replaced with a proper co-ordinate system;
Also needs to have flexibility for a z co-ordinate in the future (to allow for flying/climbing enemies)