Moving images around randomly

Scott Rossi scott at
Mon Nov 25 16:17:01 EST 2002

Recently, "Barry Levine"  wrote:

> I am developing an app that will have a number of fairly small images
> on one screen; maybe 50 pixels square. I was thinking about using image
> objects (but will listen to any suggestions). The app will have these
> objects moving about in the upper half of the window in a manner that
> I'm sure has some mathematical model. Imagine balls moving randomly
> about, each proceeding in a straight line, bouncing off the "walls"
> -and- off each other. There does not need to be any exact "precision"
> in terms of the angles at which the bounce occurs nor will the movement
> of any object be especially fast; actually, fairly slow is what we
> want. Furthermore, each of the "balls" will need to respond to a
> mouseUp event (which I know I can do without a problem).
> Before I try to re-invent the wheel, has anyone done or seen anything
> similar to this (that you would like to share)? I would imagine that
> the code resides in each object. I also would think that the direction
> of each object's travel will need to be mapped to a variable that
> changes as the object collides with another object or one of the
> "walls".

You can try the Bouncer demo posted on our downloads page (top of the list):

Also posted is "Lemmings", a drag routine that affects multiple objects and
makes for a drag effect with a very organic/lifelike feel.  This was modeled
after a Flash project I disassembled, and while I don't have the math quite
right (Richard Hertz, where are you?) this is quite a fun little stack.

Personally, I've always thought there should be more "porting" of other
behaviors/effects from other development platforms (Flash, Director, etc)
and would encourage folks who have the inclination to do so and share with
the list.


Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
E: scott at

More information about the Use-livecode mailing list