H
hunijkah
Guest
I am creating a game that allows the player to move one grid space (32x32) and then the enemies each get a turn to move one grid space.
I want the enemies to move one space towards the hero avoiding obstacles on the map.
First Attempt: I created my own recursive functions to 'walk' around an array representation of the map and determine the shortest path to the hero but after a certain map size (which wasn't that big) it would crash GM. So after a few hours on that I gave up on it.
Second Attempt: Using mp_grids. Now I have my grid set up correctly and I can set a path to the hero and have the enemy start to move on it. I know there's the option to make diagonal movement disabled which is great. The problem is how do I get the enemy to only move ONE grid space (32x32) towards the hero on the path?
Any help is greatly appreciated!
I want the enemies to move one space towards the hero avoiding obstacles on the map.
First Attempt: I created my own recursive functions to 'walk' around an array representation of the map and determine the shortest path to the hero but after a certain map size (which wasn't that big) it would crash GM. So after a few hours on that I gave up on it.
Second Attempt: Using mp_grids. Now I have my grid set up correctly and I can set a path to the hero and have the enemy start to move on it. I know there's the option to make diagonal movement disabled which is great. The problem is how do I get the enemy to only move ONE grid space (32x32) towards the hero on the path?
Any help is greatly appreciated!