PDA

View Full Version : i need jumping help



silverneo188
September 25th, 2006, 07:31 PM
i need help programing gravity and gravity to jumping.
lol i know im a noob

KIERIOSHIMOTO
September 25th, 2006, 07:44 PM
Why don't you use the gravity and jump code on nathan99's platform tutorial?
-http://n99creations.com/?pID=tutorials&col=Blue&tut=create_platform_game&p=1&l=Flash_MX_04

silverneo188
September 26th, 2006, 10:52 PM
i tried it wont work, can u help by putting the code together and replace certain things in the code with what i need to replace it with.
like i said im a noob.

evildrummer
September 27th, 2006, 05:23 PM
Well it would help to know a) what kind of game you are making and b) could you post the .fla or a version of it so we can see what you are using at the moment.

silverneo188
September 28th, 2006, 03:57 AM
(i should put this is my sig)
I CAN'T POST MY FLA. BECAUSE THERE ALWAYS TO BIG!!!!!
this can be fixed by
The owner of this site makes max file size of fla.'s BIGGER

and im making a fighting game

nakor
September 28th, 2006, 05:21 AM
Have you tried zipping your .fla?

LittleFenris
September 28th, 2006, 12:12 PM
i tried it wont work, can u help by putting the code together and replace certain things in the code with what i need to replace it with.
like i said im a noob.

You will stay a newb if you just ask people to hand you finished code and don't try and learn how to do it yourself. Start with a simple project and build on it as you learn more. If you keep asking for finished code you will never learn a thing.

evildrummer
September 28th, 2006, 01:13 PM
and about the max filesize, its so kirupa doesnt have to pay for extra space whwn half of it is used only twice, so just go to www.freewebs.com sign up and upload it there that way we can dl it.

silverneo188
October 1st, 2006, 01:21 AM
i have a tripod site.and im sorry i didn't know kirupa had little space
my site is in my sig

silverneo188
October 1st, 2006, 01:29 AM
You will stay a newb if you just ask people to hand you finished code and don't try and learn how to do it yourself. Start with a simple project and build on it as you learn more. If you keep asking for finished code you will never learn a thing.
ok srry im srry for trying.
I just started learning AS i'm not an open minded person.
I try but whenever i try doing some of it 4 myself none of it works.
i alwas get an error message.
I don't know what most of the actions do.

slideth3
October 1st, 2006, 08:28 AM
in the actions for your character type put something like this



onClipEvent(load){
grav = 0.2
yspeed = 0;
}

onClipEvent(enterFrame){

//increase velocity by gravity each frame
yspeed+=grav;

//move down by your velocity each frame;
this._y+=yspeed;


//if you hit The floor stop; floor height can be changed from 300 to your platforms height.
if(this._y+yspeed>300) (yspeed = 0, this._y = 300)

//to jump...
if(Key.isDown(Key.UP)) yspeed = -10

}


This is kind of the basics for jumping and landing on a platform. In this example though there will only be one paltform at height 300. If you want to add more platforms experiment with adding minimum and maximum x/y bounds for each platform. Just play around with the code until you're happy then move on to more platforms and stuff....

silverneo188
October 1st, 2006, 11:18 PM
thks so much srry for the trouble :mu:

silverneo188
October 1st, 2006, 11:36 PM
now I got another problem.
the ball goes to the center of the line, not the top.

i need it to where you can't jump more than once in the air.
i have the file attacheted if u need it.

slideth3
October 2nd, 2006, 07:21 AM
righto, the ball has a property called its height. Since its landing in the centre it means its registration point is the centre. The radial distance from there to the edge is half of the height

so if instead of >300 you put greater than 300-this._height/2 it should sort it out.

Alternatively just move the registration point (the little white circle thing) to the bottom of the move clip. That will sort it out too!

silverneo188
October 2nd, 2006, 07:57 PM
thks let me try...
it works thks so much

LittleFenris
October 2nd, 2006, 08:45 PM
ok srry im srry for trying.
I just started learning AS i'm not an open minded person.
I try but whenever i try doing some of it 4 myself none of it works.
i alwas get an error message.
I don't know what most of the actions do.

I am FAR from an expert in AS, but I have searched all over the net and read many tutorials on AS and Flash. I ask just as many questions as others do but I don't ask for exact code if I can help it...I just need an idea where to start then I go from there and figure it out and get it working. I have spent plenty of hours wondering why I keep getting error messages or why the code isn't working like I want it to...but I post on here or search for info on what the problem might be and eventually figure it out. It's all about persistance and reading. Luck doesn't hurt either. :)

JoMan
October 3rd, 2006, 08:18 PM
HO! It's been along time since I darkened the door of a forum buuuuut, I used to teach lots of kids how to program Sidescrollers, and although I remember nothing of AS, I still have the link to my tut. Here it is:

http://www.kirupa.com/forum/showthread.php?t=78538

You may want to jump a little far into the part where I start teaching from scratch. I hope it helps you out.

Kanpai