Platformer coding
by David Deschenes · in Game Design and Creative Issues · 02/25/2009 (6:27 pm) · 3 replies
Hey all,
i have recently began to work on a platformer and i quickly ran into a problem that i am having a hard time getting around. I am having a problem making certian platforms one way, By which i mean i want the player to be able to jump through the platform and then land on the top kinda like in mario. I know the function to perform this action but i havent yet thought of an effective way to utalize it so if anyone can provide either some advice or a snippit, it would begreatly appreciated.
i have recently began to work on a platformer and i quickly ran into a problem that i am having a hard time getting around. I am having a problem making certian platforms one way, By which i mean i want the player to be able to jump through the platform and then land on the top kinda like in mario. I know the function to perform this action but i havent yet thought of an effective way to utalize it so if anyone can provide either some advice or a snippit, it would begreatly appreciated.
About the author
#2
08/12/2009 (4:48 am)
Check the Y position compared between the player and the platform.If below the platform then disable the collision. If the player is above it then reenable it. Don't ask me how to do this codewise. I'm still very very green when it comes to TGB.
#3
08/12/2009 (5:55 am)
I haven't gotten into collisions yet in TGB but aren't there collision callbacks that when the callback happens you can perform an action if the player's velocity is down but not perform it if the player's velocity is up?
Fernando Hurtado Jr