Making an actor "jump"

Non-platform specific questions.

Making an actor "jump"

Postby Link3737 » Thu May 03, 2007 11:17 pm

i was wondering how i could do this because i've tried paths, the move to function and everything that i think could work but nothing had yet to work :cry:
Link3737
 
Posts: 1
Joined: Thu May 03, 2007 1:11 am
Score: 0 Give a positive score

check it

Postby d-soldier » Thu May 03, 2007 11:29 pm

Open the caveman game from the "tutorials" directory. Run the game and notice that the caveman jumps when you press "space". No paths or follow actions involved, just some very basic scripting.
KeyDown event (for spacebar)script editor "yvelocity = -8;"
it's that simple, assuming that the player already has some gravity applied to him in it's DRAW ACTOR EVENT (in the caveman's case)
"yvelocity = yvelocity + .5;"

I would reccomend watching all the tutorials in the HELP section for a better understanding of the basic principals of player movement. They are very helpful... or just play with the numbers in that caveman game to get an understanding of what they do inrelation to what you see on the screen. Good luck, you'll get the hang of the basic stuff within a week or so.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron