Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-26-2005, 02:26 AM   #1
Kartune85
Registered User
 
Join Date: Feb 2005
Posts: 6
Default Game troubles - Jumping

I'm having a little bit of trouble with making my character jump.

I've set boundaries and used some gravity script I found on another site but when I use the Key.isDown(Key.UP) { _y -= 25; } function, I have a problem where he stays up if you hold the key down.

I've tried using things like a while loop that the up key functions until the character hits a certain point but the game doesn't like that while loop and it freezes.

I've tried different methods but to no avail.

Can anyone help?
Kartune85 is offline   Reply With Quote
Old 02-26-2005, 03:55 AM   #2
Laguana
Well known nobody
 
Join Date: Jul 2004
Posts: 818
Default

It depends on how you want it to work, but one way to do it would be to set a variable at the start and increment it each frame/iteration, and when it's too high you make the character stop going up and thus start to fall.
__________________
Wheels i've re-invented (or what concepts i've tried to bring to flash):

Matricies
Complex numbers

Current project:

Graphing program
Laguana is offline   Reply With Quote
Old 02-26-2005, 04:08 AM   #3
Kartune85
Registered User
 
Join Date: Feb 2005
Posts: 6
Default Interesting concept

That does sound like a good concept but then the main thing is that I have to use/create some kind of function that will cut out the incrementation until he hits the floor.

Otherwise as long as the key is being pressed it will continue to increment until it reaches the cut off point but then without disabling the Key.UP movement it will continue to increment even when it gets say half way down to the ground as long as the key is being pressed.
Kartune85 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.