AtomMorph
Last updated at 10:33 pm UTC on 24 February 2003
AtomMorph is a subclass of EllipseMorph.
It has the additional instance variable velocity modeled by a Point.
Example:
a := AtomMorph new openInWorld.
a color: Color random.
[1000 timesRepeat:
[a bounceIn: World bounds.
(Delay forMilliseconds: 50) wait].
a delete]
fork.
A simulation BouncingAtomsMorph is a container for many AtomMorphs and this container sends the message #bounceIn: to every AtomMorph object it contains.
BouncingAtomsMorph new openInWorld
The BouncingAtomsMorph object is sent the message #step by the World object. (? to check)
The BouncingAtomsMorph serves as a simulation of an ideal gas.
Bring up its halo and you see that it as well serves to simulate an infection spreading (menu entry: 'start infection').
see also StarSqueak