Pathfinding Building Game (HELP)

0 favourites
  • 7 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hey guys!

    I've been working a little bit on a pathfinder building game.


    When you press the black box down at the bottom you can place a "Wall" piece anywhere on the layout. Left click the black box, right click anywhere to place the box. These boxes are supposed to be solid.

    Press "P" to switch to play mode, when you are in play mode the player will be using Pathfinder to move around. The pathfinding works perfectly except the fact that the character totally ignores the walls he just moves right through them.

    Press "B" to get into building mode. In building mode you can also move the player around.

  • superwifibattler - there's something odd happening with the code, i'm not sure what it is. perhaps something with toggling the groups to active or deactive?

    simple pathfinding works with a solid behaviour for the wall piece and adding in the action "regenerate obstacle map" when the mouse is clicked to create a new path.

    simple pathfinding

  • Thanks for the quick reply!

    I know how to get the path thing going. The point with the game is to be able to build your own levels.

  • that's what i meant by my example, your pathfinding *should* be working but there's something odd going on with the level building plus the pathfinding.

  • Add 'Regenerate Obstacle Map' to the top of Event 12. The first time you click, the player will go through obstacles but after that he wont.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You'll need to add 'regenerate obstacle map' event at the end of the build mode / start of the play mode. Path-finding needs to 'regenerate' it's map as it doesn't dynamically update when you add solid objects into play :)

  • Yaaay! I added

    On P pressed -> Regenerate Obstacle Map

    On B pressed -> Regenerate Obstacle Map

    It worked perfectly! :) Thanks a bunch.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)