Page 1 of 1

gravity

PostPosted: Thu Mar 11, 2004 9:41 pm
by hobgoblin
i need 2 things

how do i make the ground and how do i make the character jump :shock:

PostPosted: Fri Mar 12, 2004 1:49 am
by makslane

PostPosted: Fri Mar 12, 2004 1:58 am
by hobgoblin
but how i jump?

Try this

PostPosted: Fri Mar 12, 2004 11:00 am
by ingsan
First on ur mainActor :

add EVent Draw Actor
add Action Script Editor and write :

Code: Select all
yvelocity=5;

// gravity

add Event Collision (with Ground) with repeat enabled
add Action Script Editor and write :

Code: Select all
yvelocity=0;

// So that actor would be Stopped on collision with Ground


Finally add Event KeyDown(up) with repeat disabled
add Action Script Editor and write :

Code: Select all
if(yvelocity==0)
{
  y=y-30;
}


// jump

That's all :)

Re: Try this

PostPosted: Fri Mar 12, 2004 12:28 pm
by hobgoblin
[quote="ingsan"]First on ur mainActor :

add EVent Draw Actor
add Action Script Editor and write :

Code: Select all
yvelocity=5;

// gravity

add Event Collision (with Ground) with repeat enabled
add Action Script Editor and write :

Code: Select all
yvelocity=0;

// So that actor would be Stopped on collision with Ground

[quote]

i did it, but the actor doesn't stop
he just keep flying out of the screem

PostPosted: Fri Mar 12, 2004 12:48 pm
by hobgoblin
YEAH!

now ir works...

i was forgeting to put to repeat...

PostPosted: Fri Mar 12, 2004 2:51 pm
by ingsan
:P

PostPosted: Mon Sep 04, 2006 7:32 pm
by Masterburner
Thank you !!
i have a little problem
When i press the Jump button my Player dont "Jump" he "warp" to Y=30
and must i set the Values for the Walls
example:
Bottom=0
Top= 100
Right=100
Left=0

or i made something wrong ?

PostPosted: Mon Sep 04, 2006 10:02 pm
by makslane
Make the actor jump with:


Code: Select all
yvelocity = -10; //Or some other value