PDA

View Full Version : Making my Character Jump in My Flash Game


dadocta81
11-12-2003, 02:30 PM
I am creating a flash game and I have my character running and kicking and punching and all that good stuff.

Pardon the bad grammar. :-)
I want to make him jump but i just cant seem to make the code work. Currently i am usuing the Key.isDown function with the space bar as the trigger.. I just cant seem to get the right code to make him jump up and come back down. I have it on an onEnterFrame event running a function on the key press. If anyone can help me i would appreciate it.
Thank you

if you look at the file left right and down
move his direction. X Kicks Z punches.
And the Space bar is supposed to make him jump.

Colin Campbell
11-12-2003, 04:26 PM
Ahoy hoy,

I'm thinking its the onEnterFrame code. I'd change it so its more like:


_root.myHeroGuy.onLoad = function () {
//continue keyIsDown code here, with the function
//but exclude the onEnterFrame function itself, but leave
//its code. Just remove the brackets from the onEF
//and the actual onEnterFrame.
}


Hope that helps you.

Colin

annexion
11-12-2003, 09:01 PM
Where's the file?

Colin Campbell
11-12-2003, 09:10 PM
lol, I didn't know where he put the file. Obviously forgot or didn't upload it on purpose/ link to it.

dadocta81
11-12-2003, 10:12 PM
Its not letting me upload here is another try..
it tells me I cant upload unless its a jpeg or gif.. I wonder if its cause I have a mac.

oh well
you can see the file here
www.trinityeffects.com/taishiGame.htm

again the punch is
Z
and the kick is
X

annexion
11-13-2003, 02:40 AM
Then Colin, how could you infer that it was onEnterFrame code?

From looking at the swf I think he's firing the code only when the button is down.

dadocta81, you'll have to zip it to upload it.