Page 1 of 1

stop repeat jumping using onscreen keys

PostPosted: Sun Feb 28, 2010 3:19 am
by krenisis
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

Re: stop repeat jumping using onscreen keys

PostPosted: Sun Feb 28, 2010 7:22 am
by skydereign
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.

Re: stop repeat jumping using onscreen keys

PostPosted: Mon Mar 01, 2010 3:33 am
by krenisis
ok i need a ged of the jumping alone because if its mixed with other commands sometimes its confusing. thanks

Re: stop repeat jumping using onscreen keys

PostPosted: Mon Mar 01, 2010 3:46 am
by skydereign
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.

Re: stop repeat jumping using onscreen keys

PostPosted: Mon Mar 01, 2010 3:49 am
by krenisis
thanks for ged and poke shots....