How do I: Move the Player Forward or Up The Hill?

0 favourites
  • 7 posts
From the Asset Store
Complete game or template for a hill climb racing model.
  • Hello, Everyone.

    Once again I need the help of the community...

    I've been struggling with a problem on my side scrolling platformer that involves giving the player the option of choosing two paths. Either go up or continue down.

    Here's a screen capture exemplifying what i'm trying to accomplish.

    I tried to create variables that will determine the solid state of the floor objects in a way that, by pressing a key or any other event, the solid state of the upper path will activate, enabling the player to move upwards, while leaving the lower one inaccessible. The problem with this solution was finding a way to return the solid state of the upper platform to "disabled" in order to let the player access the bottom path.

    What is the most efficient way for me to accomplish this mechanic?

    Thank you all in advance

    --

  • When using the 'Solid' behaviour on your hills, you could try, with events, when a key is pressed, the solid state will be Disabled. When the key is pressed again, the state can be Enabled.

  • When using the 'Solid' behaviour on your hills, you could try, with events, when a key is pressed, the solid state will be Disabled. When the key is pressed again, the state can be Enabled.

    The problem with that is, once you release the button, the player gets stuck on that current height and just moves through the middle of the object. It's wierd...

    --

  • > When using the 'Solid' behaviour on your hills, you could try, with events, when a key is pressed, the solid state will be Disabled. When the key is pressed again, the state can be Enabled.

    >

    The problem with that is, once you release the button, the player gets stuck on that current height and just moves through the middle of the object. It's wierd...

    --

    Could you give the Capx file?

  • I have never done anything like that before but would probably try something like put an invisible sprite behind the slope and check if the player is overlapping it while pressing up or down.

    Interesting "castlevania problem" you got there

  • OK so... I placed a temporary sprite at the beginning of the ramp that, if the player holds down the UP Key while overlapping it, it will make the platform solid and, therefore, make the player go up the hill.

    If the player comes down from the hill and collides with this sprite, it disables the solid state of the said platform and the player can continue down the lower path.

    These changes can be noticed with a change of color on the temporary sprite.

    This seems to work perfectly at a singular level. The problem now is finding out a way to turn this into something global, avoiding using 4 events for every climb.

    Here's a link for the capx:

    copy.com/G24PUcVarsEqUATR

    --

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cant be done with jump-thru?

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