Pass-through edges

Discuss new features and future development.
Post Reply
singpolyma
Posts: 16
Joined: Sun Nov 09, 2008 3:33 pm
Contact:

Pass-through edges

Post by singpolyma »

I'd really like to be able to set certain edges as pass-through (ie, so a character can jump up through a platform and then land on top)
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Pass-through edges

Post by slembcke »

I'd like to do this too. Unfortunately I haven't really figured out how yet. :(

Because Chipmunk allows a small amount of overlap, it makes it difficult to determine if you should let it fall back through because it never made it all the way though, or if you should push it back up because it's resting on top.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Michael Buckley
Posts: 46
Joined: Tue Aug 21, 2007 10:30 am
Contact:

Re: Pass-through edges

Post by Michael Buckley »

It seems to me like that could be handled in a collision function. Test the velocity of the character (up or down) and whether or not its y-position is high enough. Of course, like Scott said, there is some overlap, so it's hard to tell, but in general, if an object is falling from above, it will have a greater downward velocity. If the downward velocity is small, it probably recently hit the top of its arc and hasn't fallen very far in the last step, so even if the bottom of the character is below the top of the platform, depending on how far below, you could consider it to be on top.
bluescrn
Posts: 5
Joined: Mon Aug 18, 2008 2:38 am
Contact:

Re: Pass-through edges

Post by bluescrn »

Just found this thread after posting about the same thing...

Got an idea for doing it using layers, but handling the switch between layers is a bit arkward (you don't want to turn a layer on whilst your player/object is intersecting an edge in that layer)

http://www.slembcke.net/forums/viewtopic.php?f=1&t=329
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests