Temporarily allowing a physics object to pass through another

Feb 1, 2011 at 11:07 AM


I'm building a game.  If you think of donkey kong it will be helpful.

In the game there are ladders which a user can climb to get from one level to another.  While the user is on the ladder they can pass through the floor/roof but when they're off they can't and walk on the floor.

Does anyone have any ideas on how to do this in farseers?





Feb 4, 2011 at 12:53 PM

Sort of a pain but I suppose you could have a body act as that part of the floor above the ladder, and then disable that body when:

(a) the player's y position is below the body (sor that they can climb up)

(b) the player's position is above the body and they are pushing the down arrow key (so they can climb down)

You still need to figure out the ladder effect though - I'm thinking for that maybe you just manually update the player's y position and make the player's body static while they are climbing.