Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / 2D Gravity (Platformer)

Author
Message
MrDuskling
13
Years of Service
User Offline
Joined: 30th Dec 2010
Location:
Posted: 16th Jan 2011 17:39
Please help! I have been searching all over the internet and i cant seem to find a clear tutorial on how to make gravity, and how to make my character jump. its a simple 2D game, where the objective is to jump over and dodge the walls that appear at the edge of the screen and come towards you, and i am almost finished but i just need to implement jumping. I have already posted a similar issue before, but nobody helped me. Its probably very simple, but i just cant figure it out! How do i make my character jump when I hit the space key, (i don't want to hold the space key down) and then land back down on the ground? please help!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 16th Jan 2011 19:20
Here is some example code that I wrote for a similar question. See the second post from the bottom.

http://forum.thegamecreators.com/?m=forum_view&t=177382&b=22

By the way, you did receive a suggestion from Cetobasilius in your other thread which is almost the same as this. Between the two you should be able to figure it out. In your case the jump code will be probably more complicated than my jump code in "pure form", since you need to check collision with the walls while jumping.

Login to post a reply

Server time is: 2024-11-19 14:46:05
Your offset time is: 2024-11-19 14:46:05