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

Get help using Construct 2

Post » Sat Aug 22, 2015 4:19 pm

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.
Image

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
--
B
6
S
1
Posts: 18
Reputation: 343

Post » Sat Aug 22, 2015 4:37 pm

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.
B
3
Posts: 7
Reputation: 189

Post » Sat Aug 22, 2015 5:01 pm

Westblox wrote: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...


--
B
6
S
1
Posts: 18
Reputation: 343

Post » Sat Aug 22, 2015 10:09 pm

3rdclover wrote:
Westblox wrote: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?
B
3
Posts: 7
Reputation: 189

Post » Sun Aug 23, 2015 12:24 am

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 :)
B
32
S
10
G
6
Posts: 259
Reputation: 6,776

Post » Sun Aug 23, 2015 9:38 am

Message: 3rdclover can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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:
https://copy.com/G24PUcVarsEqUATR

--
B
6
S
1
Posts: 18
Reputation: 343

Post » Sun Aug 23, 2015 10:12 am

Cant be done with jump-thru?
B
21
S
8
G
4
Posts: 66
Reputation: 3,650


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, Yahoo [Bot] and 6 guests