To make your actor jump, do this:
Your actor draw actor code:
- Code: Select all
yvelocity ++;
Key down, the key you want, script editor:
First click variables - add - name the variable jump - click add
Then write this to script editor:
- Code: Select all
if (jump == 1)
{
yvelocity = - 10;
jump = 0;
}
Then, the most important thing!!!
Collision - top side of your ground actor - repeat:yes - script editor:
- Code: Select all
jump = 1;
This works. You don't have to do anything but copy these codes to right places.