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 / jumping

Author
Message
wtfmanwtfman
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location:
Posted: 23rd Jan 2010 05:41
hey i need somehealp with making my sprite jump well it jumps but it can fly lol casue u can jst keep presing the up key
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 06:42
you can make a variable, it becomes true while jumping, and false while you are in the ground, so, when you check if the jumping key is pressed, also check if that variable is false

wtfmanwtfman
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location:
Posted: 23rd Jan 2010 15:16
ok ill try it
wtfmanwtfman
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location:
Posted: 23rd Jan 2010 15:38
what should i make i do when ever the vaibale is true i wanted to disable the key then reinable it when it hit the gound but for some reason the wont work
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 15:48
if ( dbSpaceKey() )
jump

your code is something similar right?
make it something like:


Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 26th Jan 2010 09:43 Edited at: 26th Jan 2010 09:46
make a timer. like how much you want your jump to last,
for each cycle, if your timer is larger than 0, subtract 1 to your timer, and add some height to your sprite. before you press the jump key, check to see if the jump timer is 0, and then if your jump key is being pressed. if it Is pressed, then add some time to your timer. sort of like this:



hi

Login to post a reply

Server time is: 2024-10-01 23:39:45
Your offset time is: 2024-10-01 23:39:45