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?

Comments
No Comments »
Categories
Coding
Tags
ActionScript, Collisions, CS4, Flash, Particle, Size, Variable

Comments rss Comments rss
Trackback Trackback

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

July 2010
M T W T F S S
« Jun    
 1234
567891011
12131415161718
19202122232425
262728293031  

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

“The highest reward for a person's toil is not what they get for it, but what they become by it.”

 - John Ruskin

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