Page 1 of 1

platformer questions

PostPosted: Tue Mar 13, 2012 6:04 pm
by Nykos
Hi guys, I'm trying to make a platformer that would include freerun-like moves.

So i'm trying to code a wall jump action and a climb action. Both being up and down. And i'm not very proud with what i've managed to do. It works whenever it wants, and in the direction it wants. So i guess i must have done something wrong.

Anyone would have any idea how to do that? I already checked the boards, and the Epicman demo (and i didn't understant a thing in this one :( ...)

Any help would be greatly appreciated

Re: platformer questions

PostPosted: Tue Mar 13, 2012 6:07 pm
by Hblade
Thats a hard one, but it sounds like it'd be a cool game. :) I always did like wall jumps.

Re: platformer questions

PostPosted: Tue Mar 13, 2012 6:41 pm
by skydereign
Well I think one of the simplest methods conceptually is to have special filled regions placed throughout the level. For instance if you have a tall block, it would have a region on its middle that if approached at high speeds allows you to run up it slightly, and gives the player to jump off of it. If the player reaches high enough, they can collide with another filled region type on top, that allows them to grab the ledge, and allows to pull themselves up. You can have your obstacles create the regions you want manually, since tall blocks will always have the run up the wall feature and cling to the ledge. You could do the same without the regions as well, and the idea is pretty similar. How are you controlling your actor?

Re: platformer questions

PostPosted: Tue Mar 13, 2012 7:24 pm
by Nykos
it's meant to be a pc/mac game so the player is controlled with key down on left, right, space, etc....
For the moment, the character moves left, right and jumps, and what i want is that when he collides with left or right side of obstacles, and another keydown (left control for the moment) is triggered, the player gets clung to the wall. And then, have different actions depending what key you press, up to climb, down to let fall, and space to jump in opposite direction off the wall.

At the begining i wanted to use a "state" variable in a draw event. Like state 0 for idle, state 1 for run, etc... But i didn't manage to make it work perfectly. Some problems with yvelocity.

I think filled region is a good idea, but what would be best? Colliding directly with the player, or have another actor colliding child of player, like the epicman demo by pyrometal?

By the way, thanks for the ideas guys :)

Re: platformer questions

PostPosted: Tue Mar 13, 2012 7:31 pm
by skydereign
Well if you are not using filled regions you would have to then use some colliding element for the player (instead of the player itself). Otherwise your collisions will get all screwed up. Since you were already using a state type system, I would recommend that as the best. It definitely provides the ability to do what you want. The state holds what the actor is currently doing. Because of this you can make the player do exactly what you want in every given state. So, while the up key might do one thing while the player is running, if they are in the clung to the wall state, you can tell it to go up the wall. And in draw you can make it so the actor is only influenced by gravity when you want. It sounds like you have it pretty much done, but just ran into a few minor problems.

Re: platformer questions

PostPosted: Tue Mar 13, 2012 8:32 pm
by Nykos
great, i'm not as bad as i thought i was :) i think i'll restart it from the begining to clean it. Expect me to ask more help in the next days...

Thanks for the good advice

Re: platformer questions

PostPosted: Tue Mar 13, 2012 9:30 pm
by Rufus 01
http://www.youtube.com/watch?v=2AzNkbALNUU
http://www.youtube.com/watch?v=2AzNkbALNUU

You wanna do a thing like that? :D
I played this game before I was able to speak (almost :P) :lol:
I will try to do a system to run up and jump on walls in the next days like in the video....

If its work I will upload a demo for you, maybe I will finishing it in the next week :wink:

Re: platformer questions

PostPosted: Wed Mar 14, 2012 4:51 am
by Nykos
wow man , you just made me feel older making me remembering of that game lol, i played it too :D . But yeah that's one of the thing i want to do. thanks in advance if you can help me with that.