• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Enemy/Companion Obstacle Maneuvering Without Paths?

Divinik

Member
So with my enemies/companions in the game I'm making (3/4 top down), I'm trying to figure out how to have them maneuver around around walls without paths when one is between the object and the player.

The code i have now is:

Code:
if !collision_line(x,y,player.x,player.y,obj_wall,false,false)
     {
       //move towards player
     }
else
     {
       //mp path to player
     }
I was using paths to get them there, but I find them a bit buggy and inconsistent.

any alternatives to achieve this?
 

mar_cuz

Member
You could search up steering behaviours. Pixelated Pope has some information around on it. I have found it very helpful in my game for pathfinding.
 
Top