PDA

View Full Version : athletics game



lenf
February 12th, 2004, 04:27 PM
hi,
I need some help with an athletics game I'm making. I've got the basic script to make the guy run:

onClipEvent (load) {
SpaceKeyIsUp = true;
speed = 1;
}
onClipEvent (enterFrame) {
speed -= .2;
if (speed<=0) {
speed = 0;
}
if (Key.isDown(Key.SPACE)) {
if (spaceKeyIsUp == true) {
gotoAndStop(1);
speed += 1;
}
spaceKeyIsUp = false;
} else {
spaceKeyIsUp = true;
}
_x -= speed;
}

but i want to make other events like long jump, javelin etc and i dont know how to make it so speed and angle adds upto a good throw/jump.

can anyone help me out? thanks.

InsaneMonk
February 12th, 2004, 05:08 PM
hey welcome lenf! i saw u on ssla... i will help, just give me a moment to look over the code...

lenf
February 13th, 2004, 01:17 PM
ok thanks :)

InsaneMonk
February 13th, 2004, 03:23 PM
heres a nice trig tut. you wil for sure need some use of trigonometry somewhere along the lines. take a peek. http://www.kirupa.com/developer/actionscript/trigonometry.htm

lenf
February 13th, 2004, 05:20 PM
could you give me like a basic code for a javelin game based on that code i used?^^ and then i could work on it. if you could it would be great, thanks.

InsaneMonk
February 13th, 2004, 08:07 PM
Um... hehe.... what exactly is a "javelin"?

lenf
February 14th, 2004, 06:33 AM
lol
you know in athletics when you throw a long pole, thats a javelin.

InsaneMonk
February 14th, 2004, 09:38 PM
do you throw it? or is it like pole-volting?

lenf
February 16th, 2004, 05:10 PM
you throw it.
have you seriously never heard of the athletics event javelin?

InsaneMonk
February 17th, 2004, 05:39 PM
not really... make an animation or something as an example

lenf
February 18th, 2004, 06:39 AM
you run upto a line and throw a stick as far as you can. if you go over the line its a foul.
have you played the spear toss game on makai media?