Be a Supporter!

Looking 4 acceleration physics

  • 484 Views
  • 4 Replies
New Topic Respond to this Topic
Jigganis
Jigganis
  • Member since: Nov. 7, 2003
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Looking 4 acceleration physics 2007-06-12 13:14:51 Reply

Hello all I'm a beginning scripter who's now looking for a simple and efficient slice of code that'll let me emulate acceleration of movement when moving left or right on a flat plane, as in typical 2D platformers like Mario, Sonic, or Cave Story.

I'd guess this involves a function like "while movementSpeed < maxSpeed, movement speed = movement speed + 1", but lacking experience, I can't figure it out.

Can anyone help me in regards to this? I would be extremely grateful, of course.

Kirk-Cocaine
Kirk-Cocaine
  • Member since: Aug. 17, 2003
  • Offline.
Forum Stats
Moderator
Level 38
Programmer
Response to Looking 4 acceleration physics 2007-06-12 13:30:27 Reply

AS: Movement - Asteroids ship should point you in the right direction.


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature
Jigganis
Jigganis
  • Member since: Nov. 7, 2003
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to Looking 4 acceleration physics 2007-06-12 13:41:17 Reply

Thanks a lot!

I don't mean to sound rude, but are there any more good tutorials, just in case I screw that code
up somehow?

Kirk-Cocaine
Kirk-Cocaine
  • Member since: Aug. 17, 2003
  • Offline.
Forum Stats
Moderator
Level 38
Programmer
Response to Looking 4 acceleration physics 2007-06-12 13:58:33 Reply

At 6/12/07 01:41 PM, Jigganis wrote: I don't mean to sound rude, but are there any more good tutorials

If you mean just on acceleration, you could always try flashkit.com. There's also lots of good tutorials on general AS here on NG, mainly AS: Main.


The water in Majorca don't taste like what it oughta.

| AS3: Main | AS2: Main | Flash Tutorials |

BBS Signature
TamiyaGuy
TamiyaGuy
  • Member since: Sep. 28, 2006
  • Offline.
Forum Stats
Member
Level 28
Blank Slate
Response to Looking 4 acceleration physics 2007-06-12 14:10:26 Reply

I'm making an asteroids game, and I used this tut. However, some of the things are a bit dodgy if you're using Flash 8, so if you want the AS I used, I can e-mail it you, or post it somewhere (the BBS doesn't like actionscript; it puts spaces in a load of places). My asteroids AS works really well, and is very easily edited to your specs, frame rate etc.

Or I can PM you the AS.

Don't eat yellow snow, Pepsi and coke are the same thing, etc. Visit my webpage! (go on)
Can I eat your brain? pleeeaaase?
You now have a duty in life!!! Clean up Newgrounds!!

BBS Signature