Sidescroller staircases (Similar to Castlevania)

Get help using Construct 2

Post » Sat Apr 09, 2016 2:13 pm

Before I start, I have seen the tutorials on the site for staircases and neither really do what I am looking for.

I'd like to have staircases that go from the platform level up to a jumpthru platform that gross across them. But I want to be able to walk past the stairs if the I don't hold up, or walk over the staid unless I hold down.
If I do hold up or down while approaching the stairs I'd like it to be a smooth walking transition. So the players feet never leave the ground so a falling animation won't play. I have the base of the stairs working decently, but I can't seem to get the top of the stairs to work smoothly.

The best example of this I can think of is Castlevania (although my game is not similar to it this is still how I want my stairs to work). Here's a video that sort of shows them if you are not familiar.
https://youtu.be/0BPn4hGmYts?t=906

Any help is greatly appreciated, thank you!
B
8
S
1
Posts: 4
Reputation: 408

Post » Sat Apr 09, 2016 10:54 pm

http://www.purezc.net/forums/index.php?showtopic=59665

There is a good explanation a few posts down. Basically, simple stairs are special case "tunnels" with two entrances. Normal movement mechanics would be turned off while inside the tunnel.

Another post father down mentioned an interesting idea that caught my attention too: you can use an invisible floating "raft" platform to handle the up and down motion.
Mistakes were made.
B
52
S
26
G
109
Posts: 1,616
Reputation: 61,653

Post » Sun Apr 10, 2016 4:58 am

Another idea would be to enable/disable the solid behavior for the stairs, and fall thru the floors. After a bit of head banging it works:
https://dl.dropboxusercontent.com/u/542 ... airs2.capx

The player is counting as falling even with slower speeds, but maybe the slopes are too steep. A solution to that is to only change the animation if the player is falling for a few frames.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Mon Apr 11, 2016 10:29 pm

Thanks, I will check out your cap as soon as I can. I experimented with disabling solids but I couldn't get it to work reliably.
B
8
S
1
Posts: 4
Reputation: 408

Post » Tue Apr 12, 2016 6:25 am

Thanks @R0J0hound , great work as always! This works way better than my implementation in one of my old projects. My method was based on pinning the player character to a sprite at either end of the staircase and moving the sprite towards the position of the other sprite, then unpinning the character and moving sprite back to it's initial position. That might work for an adventure game where it's ok for player character to be inactive during ascending/descending the staircase, but this method is clearly superior.
B
35
S
10
G
4
Posts: 149
Reputation: 4,559


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, FabianB and 47 guests