Page 1 of 1

HELP: the platform thru jump

PostPosted: Sat Oct 02, 2010 7:56 am
by savvy
i have noticed a lot of you want to know how to make a platform which you can jump through, and onto...
this is the simplest way to do it:

collision with top side of platform -> script editor
Code: Select all
if(yvelocity>=0)
{
physicalresponsething;
}


hope it helps :)

PS: i advise setting the platforms zdepth to behind the players, to make it look better.

Re: HELP: the platform thru jump

PostPosted: Sun Oct 03, 2010 4:43 pm
by CybrKidX
A better way would be to make it so the physical response only occurs when the down key isn't pressed. Here's an example to apply to a collision event of player and ground.
Code: Select all
char *key = GetKeyState(); // This will tell you what keys are being pressed

if(key[KEY_DOWN] == 0) // Test if down key is not pressed
{
    PhysicalResponce(...); // Now the physical response only occurs when the down key is not pressed
}


I would suggest having the collision event only occur when player collides on top of ground so if the down key is released while your still dropping through the floor, your character won't jump positions. You'll see what I mean. (If you do this, make sure you have a separate collision event for the left/right if your ground shall be used as walls later)

Re: HELP: the platform thru jump

PostPosted: Sun Oct 03, 2010 4:53 pm
by savvy
no, because it would make it so you cant press/have to press that key to be able to land on the platform.