Troubles with climbing

65 views
Skip to first unread message

Kas

unread,
Sep 10, 2014, 12:59:27 PM9/10/14
to mel...@googlegroups.com
I'm currently using 1.1.0 (finally, the new collision system! <3), but this situation carries back to the older versions.  With the engine how it is, climbing is implemented rather oddly.  If you are in contact with a ladder tile, then your gravity is set to 0.  Because of this, jumping won't work properly if you use ladder tiles, since coming in contact with one stops you vertically.

The system that I'm looking at using is a common one in platformers where you press up or down to start climbing, and it puts you into a climbing state where you only move up or down.

What would be the best way to try implementing a new climbing system?  Should I make a custom metatile (I haven't checked to see if you can do that yet =S) or am I going to have to use a custom version of the engine that doesn't make that check while implementing gravity?


Jay Oster

unread,
Sep 10, 2014, 2:52:44 PM9/10/14
to mel...@googlegroups.com
We are getting rid of ladders, because they are really stupid to work with. We also don't showcase the feature in any examples, so it goes untested, unused, and unnoticed. :P

But you will always have the option of implementing your own ladder tile that actually works correctly. The difficulty with any kind of ladder is that it requires turning your player control into a state machine. And I don't think that's well-established in the default ladder handling code. Just as you've noticed. ;)

Implementing a state machine must be done within user code, which is higher-level than what the engine can provide. Basically, you will put all of your current control input code into the "default" case of a switch statement, and then put ladder-handling control input code into the "ladder" case. So that when your player entity is in default state, you can push up (or down) while on a ladder tile, and the entity switches itself into ladder state. It can exit ladder state by: jumping, reaching the top, or bottom of the ladder, ... or whatever rules you define. The ladder state has no left/right control inputs, etc.

Kas

unread,
Sep 10, 2014, 3:23:02 PM9/10/14
to mel...@googlegroups.com


I'm okay with adding my own type of tile and implementing a basic state machine for the player (I already was doing the later for some of the logic).  I haven't dived into the new collision system so I'm glad to hear I CAN do that.  ^^

From a support stand point, I dread modifying the engine itself, since that means reimplementing them whenever it changes.

Jay Oster

unread,
Sep 10, 2014, 4:44:16 PM9/10/14
to mel...@googlegroups.com
Oh yes. No need to make changes to the library. You can do collision detection in user code, but this doesn't even require that much. Just a simple tile properties lookup and change your control input state.
Reply all
Reply to author
Forward
0 new messages