This is a bit of a tricky question but I am trying to get an enemy to pathfind me and follow me through doors that teleport me. It's pretty easy to do on a top down but side scrolling makes it a bit harder to do. I was gonna use a open/close variable so whenever I enter if the enemy touches it they will enter it also but wondering if there is a better/easier method.
Question is do you really need pathfinding in a sidescrolling platformer? You can just move left or right to follow the player with the LOS behaviour detection.
Develop games in your browser. Powerful, performant & highly capable.
Oh very true actually thank you I might use that instead. The big problem tho is getting the enemy to enter a door I go through to follow the player. I have only seen a few games do such a thing like the indie game lakeview cabin.
Just as a rough idea of pseudocode
if (player.enterdoor("id") && enemy.isfollowing) enemy.gotodoor("id") If(enemy.gotodoor("id") && enemy.collisionwithdoor("id")) enemy.gothroughdoor("id")