Pass-through edges

Discuss new features and future development.

Pass-through edges

Postby singpolyma » Sun Nov 09, 2008 3:46 pm

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)
singpolyma
 
Posts: 16
Joined: Sun Nov 09, 2008 3:33 pm

Re: Pass-through edges

Postby slembcke » Sun Nov 09, 2008 6:06 pm

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/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Pass-through edges

Postby Michael Buckley » Wed Nov 12, 2008 5:19 pm

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.
Michael Buckley
 
Posts: 46
Joined: Tue Aug 21, 2007 10:30 am

Re: Pass-through edges

Postby bluescrn » Thu Nov 27, 2008 7:49 am

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)

viewtopic.php?f=1&t=329
bluescrn
 
Posts: 5
Joined: Mon Aug 18, 2008 2:38 am


Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest