How do you run smoothly over different level ground-(stairs)

  • Hard to title this question in a limited amount of characters- what I am trying to do is make it so my character moves seamlessly over ground that is slightly different heights- for example, stairs - or running across a physics bridge etc. Currently he just gets stuck if the ground ahead is a few pixels higher and needs to jump to move ahead, and it makes for some crummy game play.

    Id love to have a value that I could set that if the ground I am currently on is within X pixels of the ground in front of me than I continue running and seamlessly go over the step. Any ideas? I looked around and didnt see any answers for this but maybe I was searching the wrong keywords... Thanks in advance!

    Edit: Might help to mention that I am working on a basic platformer game with the platform preset behaviors on my character.

  • I just threw together a real quick example to show what I am talking about a little clearer-

    in this example the player actually does go across all of the elevations seamlessly if he has his speed up fast enough... sometimes. Doesn't seam to be a for sure fail-safe thing. Try stopping in the middle and then moving through again. You will get stuck quite a bit- id love to figure it out to where you never get stuck regardless of your speed.

    In my actual game project I have physics enabled on my player and I am using the spriter plugin and spriter animations on him- but I don't think that matters. If I can get it working and get a value set that I can later adjust to fit the environment then I think I will be set. I hope one of you construct wizards is able to lend a hand! thanks!

  • There has got to be a simple solution to this... still stuck

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hope someone can provide some enlightenment on this, it's a question a lot of us newbies face I know it's been solved in various C2 games I've seen, wondering how...

  • One idea is to change the collision polygons to have a bevel to round them out.

    So instead of the corners being this:

    ----*
        |
        |
        |[/code:1pixj20c]
    They'd be this:
    [code:1pixj20c]---*    *
        |
        |[/code:1pixj20c]
    
    Another idea is to use the "overlapping at offset" condition to see if a wall is just a step and then move the player up.
    
    right key down
    player: wall to right
    player: [NOT] overlapping SolidTile at offset (32, -1)
    --- player: set y to self.y-1
    
    Instead of -1 you could use a lower value to go up larger steps.  The approach will need some tweaking.
  • So you suggest changing the collision polygon from something like this (Default)

    and try something similar to this?

    This did not seam to make any difference.

    @R0J0hound

    Good suggestions tho-

    the second part of your comment is a little advanced for me- I will try to figure it out

  • Yeah that's what I meant. My ascii art failed. Also if you can make the ground out of slopes it would work better.

    Outside of that you could make your own platform movement with events. The most useful way would be moving the player completely with physics and not using the platform movement at all.

  • R0J0hound here is my prototype ive been playing with where I am trying to get it working:

    https://dl.dropboxusercontent.com/u/247 ... index.html

    I do use slopes but even still there are a few places where he still gets stuck - on this bridge for instance movement is not very fluid at all.

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