How do I platformer tap to move

0 favourites
  • 3 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • I'm trying to make a character be able to move around a side scrolling environment via tapping then having the character be able to navigate to that location.

    At first I tried pathfinding. But was unable to figure out how to keep the character grounded on the floor of the environment.

    Next I tried a combination of the platformer behavior and the 8 direction one for when the player needs to climb up a ladder.

    Im making a series of conditions that look at the height Vs side of the tap location Vs the player position. And determining things like I'd the player is overlapping a ladder etc, but it's still not quite working smoothly.

    Does anyone have a test scene with a control setup like this or another way to approach this type of movement to?

    Thx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you checked out this tutorial yet?

    https://www.scirra.com/tutorials/1115/a ... latformers

    One thing you can do is have triggers set all around the environment that change the character's 'state' as it approaches an obstacle or ladder or such. For example, a jump trigger on either side of a pit, or a climb trigger at the base of a ladder. The jump trigger would of course active the jump action, and the climb trigger actives the 'Climb' state, which plays the climbing animation as they move up the ladder, as well as whatever climb behavior you have set, so long as the character's state is currently set to 'Climb.'

    If you click to the right of the character, and they're not on a ladder or in the middle of a jump, you start the 'Right' state, in which they continuously simulate right movement. Ditto for clicking to their left and activating the 'Left' state. If they're about to walk over a pit, there should be jump triggers there that make the character automatically jump once it collides with them.

    That would work for very simple cases, step by step or trigger to trigger, but it wouldn't work in more advanced cases. For example, in this case:

    You can click on the checkmark, but since the ladder is to the character's left and the right-ward click means the 'Right' state has been activated, the character wouldn't properly reach the climb trigger to go up the ladder. You have to figure out what the next step is (the ladder) and click on it, and once you're up the ladder think about the next step (go right) and so on.

    I suppose to go more steps ahead automatically, you'd need to make these triggers perform double duty as waypoints. Here's a bit on that from the same guy:

    https://www.scirra.com/tutorials/1113/a ... -waypoints

    Not entirely sure how to implement that, aside from having every waypoint know what path needs to be taken to reach any other waypoint. Hopefully someone has an easier solution for a more advanced pathfinding.

  • Thanks Nemlokt - Lots of great information!

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