Page 1 of 1

Hill Climbing in Side-Scolling Platformers

PostPosted: Tue May 27, 2014 6:19 pm
by Turon
I do not recall seeing any game editor made platformers that allow you to climb uneven surfaces akin to those found in Sonic the Hedgehog and Kirby's Adventure and New Super Mario Bros. Wii. Is it possible? It sure wouldn't use a normal collision system to make it work would it?

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Tue May 27, 2014 7:55 pm
by lcl
Of course it is possible. It's just a matter of how you manage your movement. One way could be to somehow make the character notice that it's climbing a hill and use an alternate movement code at those times.

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Wed May 28, 2014 4:20 pm
by Turon
And how would the system desern between steep walls from slopes?

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Wed May 28, 2014 6:19 pm
by lcl
You'd have to think of a way to do that. You could use different actors for slopes and walls, or you could make the actor check two points ahead of it, with same x coordinate and different y coordinate, to find out the shape. What I mean with this is better explained via a picture:

slopeOrWall.png

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Wed May 28, 2014 7:25 pm
by Turon
Thanks I think that might help :) .

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Thu May 29, 2014 9:23 pm
by Hblade
There's a simpler way to do something similar. That's to have a collision actor, with 1 pixel width from the bottom, and it gets wider at the top (Almost like a diamond) but instead of sharp edges on left and right sides, make it look more like a spin-top. This will allow you to prettymuch stand on the surfaces like that without sliding that much :)

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Fri May 30, 2014 9:33 am
by Turon
So if you just collide with the top side of the ground then it is a slope and if your colliding with the right side of the ground then its a cliff?

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Fri May 30, 2014 3:38 pm
by Hblade
Sort of. Are you talking about that sticky-effect when you collide into a wall?

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Sun Jun 01, 2014 8:48 am
by Turon
Sticky Effect?

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Sun Jun 01, 2014 12:29 pm
by Hblade
Yeah, where if you walk into a wall while jumping he'll stick to it.

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Sat Jun 07, 2014 9:59 pm
by speckford123
Hblade wrote:Yeah, where if you walk into a wall while jumping he'll stick to it.

is there an easy way to fix that?
I always created custom variables yvel and xvel that I used in place of yvelocity and xvelocity so that physical responses wouldn't change them.

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Sun Jun 08, 2014 12:17 am
by NightOfHorror
Hey Speck, long time no see, anything going on with you?

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Sun Jun 08, 2014 3:37 am
by skydereign
speckford123 wrote:
Hblade wrote:Yeah, where if you walk into a wall while jumping he'll stick to it.

is there an easy way to fix that?
I always created custom variables yvel and xvel that I used in place of yvelocity and xvelocity so that physical responses wouldn't change them.

Well you can do that with temporary variables instead of completely replacing them with xvel and yvel.
Code: Select all
double yvel = yvelocity;
// PhysicalResponse here
yvelocity = yvel;

But otherwise no, if you are using PhysicalResponse you'll need to somehow store the previous velocity to prevent sticking.

Re: Hill Climbing in Side-Scolling Platformers

PostPosted: Tue Jun 17, 2014 1:48 am
by Zivouhr
Another way is to have a tile for walking, and a tile for steps made separately, using 45 degree angles and so on. The steps, when collided with the player, could have a physical response 1, 1, 0, 1 or so on, so the player doesn't fall through, and then add for any side of the steps/slope, a yvelocity-=2; That will make the player's normal physics yvelocity++; or yvelocity+=1.5; be able to overcome the gravity and allow the player to climb up steeper angled slopes or stairs. Minus equals UP, plus equals down for Yvelocities.

There is also a demo of Game Editor, that uses double yvel = yvelocity; that Skydereign mentions, which is also great for preventing players from jumping up the sides of walls/tiles.