stop repeat jumping using onscreen keys

Talk about making games.

stop repeat jumping using onscreen keys

Postby krenisis » Sun Feb 28, 2010 3:19 am

How do i program it where i dont repeat jumping with onscreen keys. I tried the regular code but it doesnt work. I need example GED. thank you
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: stop repeat jumping using onscreen keys

Postby skydereign » Sun Feb 28, 2010 7:22 am

My ged examples never seem to work for you, so I'll explain it. Seeing as you did not describe the method for onscreen buttons you are using right now, I don't know what method would work best. Essentially it should work just like normal jumping code, but it seemed you never could get that working. The only difference is the jump event would be a mouse button down event...

You will need a variable to hold jump. Then on mouse button down of the jump key, put code like this.
JumpButton -> Mouse Button Down -> Script Editor
Code: Select all
if(jump==1)
{
    playerActor.yvelocity=-15;
    jump=0;
}


The setting of jump still works through collision with the ground, meaning still the player actor's event. If you still want a ged of this, then ask, though this is pretty regular code, only twist is the setting of another actors yvelocity.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: stop repeat jumping using onscreen keys

Postby krenisis » Mon Mar 01, 2010 3:33 am

ok i need a ged of the jumping alone because if its mixed with other commands sometimes its confusing. thanks
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: stop repeat jumping using onscreen keys

Postby skydereign » Mon Mar 01, 2010 3:46 am

So you mean you didn't figure out jumping at all.. Here is a ged of it, it is just like I said, I am assuming you have a basic understanding of variables.
Attachments
jump.zip
(28.56 KiB) Downloaded 53 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: stop repeat jumping using onscreen keys

Postby krenisis » Mon Mar 01, 2010 3:49 am

thanks for ged and poke shots....
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron