How do I implement stairs and raised floors?

0 favourites
  • 11 posts
From the Asset Store
************ 2D top down floor spikes **************
  • I have stairs that lead to a higher level, and I'm unsure how to get my character to walk up them realistically. I assume they don't need to end up above their original Y value on the second floor since the boundaries will keep them from walking off the edges anyway (other than the stairs). Any ideas?

  • Do sprites normally walk up stairs realistically in a top down game? What do you mean?

  • Do sprites normally walk up stairs realistically in a top down game? What do you mean?

    I guess what I'm looking for is maybe an animation or camera solution to make it at least look like stairs are being walked up and not over. Stairs along the X axis going to a higher second floor may be a better example than the ones I'm showing.

  • All I can think of is you can scale the player character bigger so it looks like they are moving closer to the camera. Any changes to the camera itself with layout scale I think would just look like a moving camera and not really give an effect of walking up stairs.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have seen some games slow the player and camera speed while on stairs, to give the sense that they're climbing up or down. Sometimes it's coupled with a unique walk cycle animation. Food for thought!

  • I have seen some games slow the player and camera speed while on stairs, to give the sense that they're climbing up or down. Sometimes it's coupled with a unique walk cycle animation. Food for thought!

    Definitely on my list of options, thank you!

  • All I can think of is you can scale the player character bigger so it looks like they are moving closer to the camera. Any changes to the camera itself with layout scale I think would just look like a moving camera and not really give an effect of walking up stairs.

    Yeah I really don't know how to go about it. It does technically look "right" with the boundaries and other stuff I have in place (like characters appearing behind the railings while on that floor, and in front of them while below). It just seems like it's missing something. I'll try the scaling option too

  • I have seen some games slow the player and camera speed while on stairs, to give the sense that they're climbing up or down. Sometimes it's coupled with a unique walk cycle animation. Food for thought!

    Tried this along with changing the scale per stair traveled and it's better than nothing for sure. Still wondering if there's a better way somewhere out there. I'll keep looking

  • Let us know what you end up with! I'm sure a lot of people would love to know!

  • Let us know what you end up with! I'm sure a lot of people would love to know!

    I found somewhere that introducing a slight Y bias when on stairs as you move past them (and mirrored as you go down) would work. The example looked exactly like what I need, I just haven't figured out how to add the code for it yet.

    For anyone interested I figured out a solution! It was very simple once I realized I needed to mess with Y values. Vertical stairs don't require anything to look nice, just the slowdown.

    I applied slowdown, same as vertical stairs, to my horizontal stairs using their own trigger box. When I'm overlapping the trigger my character's Y value is increased or decreased very slightly depending on which way the stairs are facing and if you're going up or down them. Here is the code I came up with. It says +/- 0.1 in the code, but making it +/- 0.2 makes it much, much smoother.

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