Old school ladders
Opened this issue · 1 comments
gomutako commented
phoboslab commented
How exactly these would behave is very game specific; I don't think it makes sense to support this type of "collision" directly in the engine.
Without thinking about it too much, here's how I would do it:
- Create an invisible, resizable entity
ladder
and position it to cover the graphics. - Set your player to check against this entity. E.g.
player->check_against = ENTITY_GROUP_ITEM
,ladder->group = ENTITY_GROUP_ITEM
. - In your
player->touches()
check forother->type == ENTITY_TYPE_LADDER
and set a flagself->player.on_ladder = true
- In your
player->update()
check for this flag and change the behavior accordingly. E.g.self->gravity = 0
, setself->vel.y
on up/down arrow.