"Sticky" platformer

0 favourites
From the Asset Store
Make your dream action platformer game effortlessly with this template!
  • This isn't in the bugs section because I am not sure it is a bug.

    Basically, I have noticed that a platform-enabled object will 'stick' to walls of an incredibly steep slope (anything short of vertical). This is a big problem as most people don't want their players being able to make their way up cliffs.

    Here's an example. Totally default behaviors in a new project.

    <img src="http://i.imgur.com/tl0mu.jpg" border="0" />

    It gets even more insane!

    <img src="http://i.imgur.com/FXbcZ.jpg" border="0" />

    Is there any way to fix this manually? Or could Scirra implement a solution? Because I am sure this is not what 99% of platform games need!

  • You could do this manually some how.

    something like:

    Player.IsNearWall(Left)

    Wall.Angle >= 70 // Or what ever is your max angle etc.

         -> Player.applyVectorX(-2) // this is out of my head, so im not sure if this is the exact action but its something to do with vector x. And you might have to change it to a possible value.

    Hope that helps you figure it out.

  • That would work, however the problem lies in finding the angle of the wall relative to the player, since my game is gravity-shifting and rotating.

    And still, this doesn't seem to be the best way to solve the problem, I am sure there would be issues...

  • This sample file may can help you doing what you want. I think if you make a mask around the player, aligned by his middle/bottom point, and overlapping the walls, you will can detect the walls and use this system to make him drop away.

    The mask need to be bigger than the player, and you set what walls can ignore this system by using a collision check on another object (the wall, for example)

    dl.dropbox.com/u/47035927/temp/SandBox-R007.rar

    dl.dropbox.com/u/47035927/sandbox/index.html

  • All right, I managed to achieve it with invisible collision objects. However perhaps Ashley could consider adding this as an official feature?

  • Agreed, this would be awesome =]

  • This could be a very complicated feature to add to the platform behavior itself - it's already one of the most complex behaviors, and it currently does not care what it is standing on. For example, you could also stand on a single pixel, so by the same rule you can land on a very steep slope. I'll see if it's straightforward to fix the Platform behavior to drop down in this case, but it might not be, so it would be best to work around this with events or careful level design for the time being.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, sure Ashley! This could of course be something to be left to the event sheet.

  • Collision issues are always fun. :)

    Thanks for noting this.

  • This could be a very complicated feature to add to the platform behavior itself - it's already one of the most complex behaviors, and it currently does not care what it is standing on. For example, you could also stand on a single pixel, so by the same rule you can land on a very steep slope. I'll see if it's straightforward to fix the Platform behavior to drop down in this case, but it might not be, so it would be best to work around this with events or careful level design for the time being.

    I'm trying to learn fast to use C2 to develop a nice platform tutorial.

    So, my workaround for this issue will be something like this:

    I'll setup three slave detectors for my player gadget, as I did in the SandBOX (to detect edges and climb them, try it and look how awesome ^^ ).

    If the bottom detector is overlapping the ground families, and the top isn't, and the middle detector is overlapping too, so, the player is on a climb, if the bottom is overlapping the ground and every other aren't, so, the player is on ground, if the top detector, the middle, and the bottom are detecting, he is on a wall.

    But, this will bug the climbing logic, so, I'll make conditionals using "UP" and "RIGHT/LEFT" to keep him climbing, if not, he will be pushed out the wall or slip down.

    So, Ashley, I don't know how you're doing the logic for behaviors, but if you're checking the collision box to make the "triggers" for example, you may can try check how much % of the sprite area is overlapping the wall instead of checking if the collision box is touching a bottom pixel.

  • TELLES0808

    I managed to implement a system that works fairly well, and you can pretty much choose the steepness threshold.

    You only need two objects, the left foot and the right foot. They stick into the ground below the player, jutting out any amount you want.

    Therefore, if only ONE is overlapping the ground, you know you are on a steep slope, as one will be hanging in midair.

    This is the easiest and simplest way I could think of achieving this, and it worked well.

  • but if you walk near edges, to jump far (sometimes a precise jump, like in jumping games), you'll not step back?

    I thought about it before, but this was my main issue when using two feets. When the player come near of an edge to jump far, or climbed up a wall, he felt back because of this solution.

    Maybe a mix, checking the two feet and the middle right/left, can workaround it =]

    Edited: Pewwwwwwww.

    My brain is burning =

    At least I finished it and I hope it's working flawless =|

    take a look one the SandBOX.

  • sqiddster

    I'm sorry i know this is very old post.

    But can you please share simple Capx showing how to solve this problem.

    I'm stuck on my game because of this issue.

    Thank's alot

  • To be honest I still haven't solved it very effectively. My old solution didn't work that well.

  • I've got the same problem as squiddster. Sometimes (its very rare, though) the sticky behavior can be observed on perfectly flat wall... I hope Ashley will find solution, I'm not feeling well knowing it might end in describing all conditions via event sheet, just seems too complicated...

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