O'Reilly logo

The Essential Guide to Physics for Flash Games, Animation, and Simulations by Adrian Dobre, Dev Ramtal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Particle animations with long-range forces

It's now time to transcend reality and start playing around with particles and physics. In this section, we'll be moving lots of particles around under the action of long-range forces and create some interesting patterns and animations.

In this section and the next, we'll generally be dealing with large numbers of particles and lots of calculations. To reduce any unnecessary overheads, we shall therefore make use of a slightly lighter version of the Ball class that we'll call Star. The Star class is similar to the Ball class, but does not draw a gradient fill and so does away with the extra code needed to do that. The remaining examples in this chapter will make use of the Star class.

Particle paths ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required