Directional collision - how would I do it?
by Max Nichols · in Torque Game Builder · 02/28/2008 (1:01 pm) · 3 replies
Ok, I'm making a simple platformer just to get my hands dirty and figure out how to work the engine. Part of what I want to do is make a platform that only has collision on top, coming from above. Meaning that the avatar can jump up from below the platform just fine, or move through it from the side... but if they jump from above the platform, they can still land on it. Its similar to a lot of platforms in games like Super mario World or Super Smash Bros, to name examples everyone should be familiar with.
How would I go about doing this? Or is there an easier way to achieve the effect I want that doesn't involve complex collision?
How would I go about doing this? Or is there an easier way to achieve the effect I want that doesn't involve complex collision?
#2
03/10/2008 (10:33 am)
Alright, thanks a lot. At least it's a start.
#3
06/13/2008 (11:50 pm)
Hi Max. There are a lot of ways to do this. one way is to make a trigger on the platforms you want to jump on. Then you can turn the collisions on for the platform you're jumping on. I did something similar to this in a game I was writing where I would have my character run past some stairs. If you wanted to climb those stairs then you would just have to hold the up key to climb the stairs. Basically i had an onStay even that accepted my up key to change the collision on the stairs.. when I came down the stairs I had an onEnter callback that would automatically switch the stairs back to the background after I passed it. there has to be a ton of ways to do this though.
Torque Owner Kevin James
I'm still trying to figure it out myself!