Help: pathfinding and picking nth instance

0 favourites
  • 1 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am making a turret defense game where players can place a wall to make the enemies walk further. However, when I want to delete a specific instance that blocks the enemies' path entirely, all the commands I have tried destroy all instances of the wall instead of the one right in the path. I am still learning the C2 language and do not have the best organizational/grouping skills with the language either. I've spent hours trying different options, downloading other examples, looking at suggestions on the forums, and nothing has worked, which leads me to believe this is a pathfinding issue and not a pick instance issue.

    The method that I have made the most progress with is to create a global number that ticks everytime a wall is made along with and ID for each instance of a wall. Then I pick the last instance that was made and destroy.

    See image below.

    NumberOfDogwalls is the instance ID and NumberOfDogwallsGlobal is the global counter.

    The specific code I am referring to is at the bottom of the L1-1 event sheet. The capx link is below. Again, any help with this issue would be greatly appreciated. Thanks.

    <img src="" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)