So, I'm trying to make a turn based, grid-based puzzle shooter thing. My issue is that I finally worked out the AI for the enemy slimes, which is that they determine if the player is closer up and down, or left and right, then moves one tile(32 pixles) in the cardinal direction the player is further from. The problem with this is that one slime moves correctly, but when you have more then one slime, they all move in the same direction. it appears that the slime with the lowest id determines the movement of all the others. I really don't want to copy and modify the code for every instance of the slime, as I plan to have many different kinds of slimes running the same basic movement. How would I break this out so the code runs for each slime individually?
I am super new to construct 2, so it could well be something basic.
Thanks!
-Aidan
imgbb.com image hosting services free