r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.
  • rss
  • Home
  • About
  • Email

ActionScript 3.0: Variable Size Particle Collisions

r3dux | January 25, 2010

Ha! I’ve cracked it! This really shouldn’t have taken me as long as it did to get working, but now I can have pegs and balls of any size I fancy, and the collision detection works flawlessly. No more cheaky bodges to avoid double collisions, proper trig. offsets all the way… In fact, the only bodge left is adding a slight horizontal speed jitter to a ball if it ends up with a horizontal velocity of < 0.01 after a collision, because if it's bang over over the centre of the peg it'll stay there happily bouncing away until it comes to rest otherwise - which I think is fair enough.

So after all the additional hours, does it look any better? Nope… If anything it looks worse – but she’s my baby, and I’ve finally got ‘er working properly, so I don’t care! :D

Update: And by flawlessly, I mean that I’ve just noticed a very small ball going fast will go through a very small peg, because they never intersect… Drats! Guess I’ll have to check for ranged collisions (or increase the minimal ball/peg size, or limit the movement speed). Nothing’s ever easy, is it?

Related posts:

  1. ActionScript 3.0 Particle Systems #1: Random Motion
  2. ActionScript 3.0 Particle Systems #6: Particle Attraction
  3. ActionScript 3.0 Particle Systems #3: Rain Effect
  4. ActionScript 3.0 Particle Systems #2: Snow Effect
  5. ActionScript 3.0 Particle Systems #4: Bubbles
Categories
Coding
Tags
ActionScript, Collisions, CS4, Flash, Particle, Size, Variable

Comments rss
Comments rss
Trackback
Trackback
Print This Post Print This Post

« ActionScript 3.0: Per-Pixel Collision Detection inna rub-a-dub Peggle Stylee Someone Once Told Me »

Leave a Reply

Click here to cancel reply.

Translate

Categories

Archives

  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009

Post Calendar

January 2010
M T W T F S S
« Dec   Feb »
 123
45678910
11121314151617
18192021222324
25262728293031

Tags

10.04 360 ActionScript ActionScript 3.0 Adobe Ballarat Bash Compiz Controller CS4 CUFDIG302A Effect Film Fire Flash Gaming Hack How-To install Jaunty Josh Joplin Group Linkage Linux Little Big Planet Motion mount Music NAS Particle photography Photoshop Problem PS3 r3dux.org Retro Slides Softmod Sound Systems Ubuntu Video VirtualBox Wii Windows XBox

Linkage

  • 9GAG
  • A Day in the Life of Jim
  • Truxnor.net

Gamercard

Prepare for Awesome

Misc.

Creative Commons License

stopsoftwarepatents.eu petition banner

“Weakness of attitude becomes weakness of character.”

 - Albert Einstein

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox