"Sticky" platformer

Forum Home Forum Home > Construct 2 General > Construct 2 general
 Post Reply Post Reply Page  12>
Author
19,099 Rep
Post Options Post Options   Quote sqiddster Quote  Post ReplyReply Direct Link To This Post Topic: "Sticky" platformer
    Posted: 05 Feb 2012 at 12:54pm
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.



It gets even more insane!



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!

Edited by sqiddster - 05 Feb 2012 at 12:57pm
Back to Top
5,350 Rep
Post Options Post Options   Quote smitchell Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 1:26pm
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.
In memory of flash :'(
Back to Top
19,099 Rep
Post Options Post Options   Quote sqiddster Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 2:57pm
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...
Back to Top
10,072 Rep
Post Options Post Options   Quote TELLES0808 Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 3:06pm
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)

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

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

Edited by TELLES0808 - 05 Feb 2012 at 3:08pm
   
Back to Top
19,099 Rep
Post Options Post Options   Quote sqiddster Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 4:09pm
All right, I managed to achieve it with invisible collision objects. However perhaps @Ashley could consider adding this as an official feature?
Back to Top
10,072 Rep
Post Options Post Options   Quote TELLES0808 Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 4:43pm
Agreed, this would be awesome =]
   
Back to Top

Scirra Developer
78,417 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 8:52pm
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.

Edited by Ashley - 05 Feb 2012 at 8:53pm
Back to Top
19,099 Rep
Post Options Post Options   Quote sqiddster Quote  Post ReplyReply Direct Link To This Post Posted: 05 Feb 2012 at 9:54pm
OK, sure @Ashley! This could of course be something to be left to the event sheet.
Back to Top
1,698 Rep
Post Options Post Options   Quote Khaz Quote  Post ReplyReply Direct Link To This Post Posted: 06 Feb 2012 at 10:09am
Collision issues are always fun. :)

Thanks for noting this.
Back to Top
10,072 Rep
Post Options Post Options   Quote TELLES0808 Quote  Post ReplyReply Direct Link To This Post Posted: 16 Feb 2012 at 6:04pm
Originally posted by Ashley Ashley wrote:

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.
   
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down