noob question gravity

Non-platform specific questions.

noob question gravity

Postby Flob » Sun Nov 26, 2006 10:41 pm

In a simple 2d game like Super mario brothers, how would you script "gravity" on to an actor?
Flob
 
Posts: 9
Joined: Sun Nov 26, 2006 5:35 pm
Score: 0 Give a positive score

Postby Hedfone » Sun Nov 26, 2006 10:43 pm

just follow the tutorial located in the copy of GE that you downloaded

(Game Editor-> Help-> Game Stuff-> Gravity)
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Postby Zehper48 » Sun Nov 26, 2006 11:15 pm

add a draw actor event and put this
Code: Select all
yvelocity+8;
i think that shoud lwork
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby makslane » Sun Nov 26, 2006 11:26 pm

Code: Select all
yvelocity += .8; //for example
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Hedfone » Mon Nov 27, 2006 12:32 am

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
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Postby Flob » Tue Nov 28, 2006 5:14 pm

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?
Flob
 
Posts: 9
Joined: Sun Nov 26, 2006 5:35 pm
Score: 0 Give a positive score

Postby makslane » Tue Nov 28, 2006 5:33 pm

makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest