Making an actor "jump"
Posted:
Thu May 03, 2007 11:17 pm
by Link3737
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
check it
Posted:
Thu May 03, 2007 11:29 pm
by d-soldier
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.