# Need help in 2D Platformer creation!

I started this morning creating 2D platformer, and now I have following basic controls done: Moving right, moving left and now I just need to make jump somehow. I have done event where consitions are Spacebar is pressed and timer “JumpRate” is over 1.5sec, and actions are “reset timer “JumpRate”” and add force to object x:0 y:-9000. It goes up, But I dont know how I get it to fall back to surface (if this wouldnt be PLATFORMER game, I may force it to surface coordinates, but cause it is, surface is on diferent coordinates all-time). I hope somebody would help me, this is my first post here ever, and this is my first game ever (on Game Develop, I have done several short game-demos in Construct 2, but then I moved to linux, just before I was going to pay 100\$ for personal licence to construct 2, cause windows decided to corrupt EVERYTHING. Then I found pay-what-you-want software called Game Develop, and it seems have MUCH more powerful event system, and its still quite easy to use)

Hi.

What I would do,is

1.force player on Y axes to move down by default
2.set collision between player and platform to prevent player fall through the platform
3.create a variable calld jump and set the value by default = 0
4.check the collision between player and platform
5.when the player collide with platform “not jumping” set jump = 0
6.when the player not collide with platform so the player is jumping,set jump = 1
7.when jump = 1 force player to move down on Y axis
8.use a timer to set how long to wait (how high the player can jump) before force the player to fall down.

I don’t have the time to make it and test it for you,but I hope it helps to get the idea how to do it.
The key is,don’t use platform cordinates,only force the player to move down or up,and use collision between the player and platform to prevent player fall through.This way you don’t have to worry about where is the surface.
Check collision,this way you know,if the player is jumping or not.If jumping,force it to move down.

Thankyou for reply! Sorry, but I have now done it a way thtát someone told me on private messages -physics autonism.