Page 1 of 1

Jump havoc

PostPosted: Sun Jan 13, 2008 4:55 pm
by lordezak
can any1 help me with my jumping problems - i want it so i jump only twice then he falls - at the moment he can jump an infinite amount of times which allows a lot of glithes and cheats :( can any1 help me thanx :)

Re: Jump havoc

PostPosted: Sun Jan 13, 2008 5:06 pm
by Azou
You need to add a variable called canJump
Then,make an actor called platform,who is Filled Region.
Key down/Key for jump/Disable(on repeat)/script editor

if(canjump==1) // if he has collided with the floor
{yvelocity =-18; //jump
canjump=0;} // and he can't jump again until he touches the floor

Then draw actor/script editor:

yvelocity +=1;

After:
Collision/Top side of platform/Repeat this event Yes/Physical response/Event actor 0

Finally:
Collision/Top side of platform/Repeat No/script editor

canjump=1; // the variable canjump represents the ability to jump. if it's 1, you can jump.
//if it's 0, u can't jump
// in this case the platform is the invisible blue frame at the bottom.

Yo! It is so long,but this is working! :mrgreen:

Re: Jump havoc

PostPosted: Sun Jan 13, 2008 5:15 pm
by lordezak
anything simpler which doesnt require code? :? :(

Re: Jump havoc

PostPosted: Sun Jan 13, 2008 5:31 pm
by Azou
No,unhappily,this is the single method i found :? :|

Re: Jump havoc

PostPosted: Mon Jan 14, 2008 2:05 pm
by Kalladdolf
yup, azou's right about the code, just one thing...
the platform doesn't exactly need to be a filled region. It can be anything, your ground animation, or whatever =D

it's actually easier than it seems. getting used to work with variables and the "if"-function is a bigger step, but it's a great success once you know how to use it.
you know the guy's more advanced and no beginner anymore once he knows this kinda stuff, because then he'll be able to make really great games (where you can win, lose, restart, save etc)
have fun :D

Re: Jump havoc

PostPosted: Wed Jan 16, 2008 2:51 pm
by Azou
:D
Janinmax is right.
And ifyu wanna make games;so you have to code every time :D

Re: Jump havoc

PostPosted: Tue Jan 22, 2008 10:31 pm
by blackguy95
ok try this, create a variable called jump. then create a keydown event on the desired actor "jump key"
then go to the "conditional action" command. then type in the top box "jump",and in the bottombox "1". then
set the middle button to "equal to" "this is saying do this only if jump =1" then go to script editor and type this in
yvelocity=yvelocity- "jump height here" ; then press enter and type in jump=0;.
after this create a collision event and put when event actor collides with "the actor representing your floor".
then go to the "script editor command"and type in jump=1;
thats it!



sorry but this is as simple as i could get it without the complicated code, hope you can understand :D