Page 1 of 1

noob question gravity

PostPosted: Sun Nov 26, 2006 10:41 pm
by Flob
In a simple 2d game like Super mario brothers, how would you script "gravity" on to an actor?

PostPosted: Sun Nov 26, 2006 10:43 pm
by Hedfone
just follow the tutorial located in the copy of GE that you downloaded

(Game Editor-> Help-> Game Stuff-> Gravity)

PostPosted: Sun Nov 26, 2006 11:15 pm
by Zehper48
add a draw actor event and put this
Code: Select all
yvelocity+8;
i think that shoud lwork

PostPosted: Sun Nov 26, 2006 11:26 pm
by makslane
Code: Select all
yvelocity += .8; //for example

PostPosted: Mon Nov 27, 2006 12:32 am
by Hedfone
on draw actor you put
Code: Select all
yvelocity+=.5;


and on the keydown that you use to jump put
Code: Select all
yvelocity=-8;


otherwise you'd just flyupwards into space :D:P

PostPosted: Tue Nov 28, 2006 5:14 pm
by Flob
OK, i have the gravity and they keydown W to make him jump, I used a physical response for the collision on the ground, however, you have to press W (jump) multiple times to get the character to jump, sometimes he jumps on the frist time you press the button, other times its up to 4, any ideas?

PostPosted: Tue Nov 28, 2006 5:33 pm
by makslane