jumping
Posted:
Fri Oct 05, 2007 11:54 am
by elite
hi, again, i would like to know how to stop making the player jump continously when plressing the space bar too much times. Because in my game, if i keep pressing the space bar, the player keeps going higher and higher, and i dont want any idiot that plays my game to just keep jumping around and skipping the enemies. Any suggestions?
Thanks
Twigser
Re: jumping
Posted:
Fri Oct 05, 2007 12:07 pm
by Kalladdolf
make a variable called canjump.
For your player goes:
Collision -> top side -> platform -> Script Editor ->
- Code: Select all
canjump=1;
Draw actor ->
- Code: Select all
yvelocity += 1;
Key down -> space -> repeat: NO -> Script Editor ->
- Code: Select all
if(canjump==1)
{yvelocíty = - 15; canjump = 0;}
Re: jumping
Posted:
Fri Oct 05, 2007 12:12 pm
by Spidy
click on script menu bar than add an actor variable called 'canjump'.on your player event add a colision event relating to a ground with a script editor than :
"canjump = 1;"
and your player key down event whatever you choosy jump button and make the script say
if(canjump==1)
{
yvelocity = -8;
canjump =0;
}
here is the answer
Re: jumping
Posted:
Fri Oct 05, 2007 12:16 pm
by Kalladdolf
Re: jumping
Posted:
Fri Oct 05, 2007 12:31 pm
by Bee-Ant
He just try to complete your answer...
Re: jumping
Posted:
Fri Oct 05, 2007 12:51 pm
by elite
oh yeah! thanks again
oh wait a minute, im a bit new to game editor, what do you mean by platform? (gasps in crowd)
Re: jumping
Posted:
Fri Oct 05, 2007 12:59 pm
by Bee-Ant
elite wrote:what do you mean by platform? (gasps in crowd)
Platform is a GROUND Actor, where your player stand...
Re: jumping
Posted:
Fri Oct 05, 2007 1:09 pm
by elite
Hmm I tried again but it dodnt work, i probably did something wrong, I copied and pasted all the code, but it still jumps multiple times in the air when I keep pressing the spacebar.
Re: jumping
Posted:
Fri Oct 05, 2007 1:15 pm
by Bee-Ant
Hey...dont copy-paste...it wouldn't work...wait...I'll make a demo...just 5 minutes...
Re: jumping
Posted:
Fri Oct 05, 2007 3:36 pm
by Spidy
y r great bee-ant thx for the answer to kalladdolf
Re: jumping
Posted:
Fri Oct 05, 2007 3:42 pm
by Bee-Ant
I just answer with what I have saw...
Btw, you're welcome.