This is my founts demo/program which was inspired by Eric's Cascade. I only
saw the still images of Eric's Cascade and from those inferred what the
program must be doing. I thought $39 for a screen saver which couldn't have
taken more than a couple of weeks to write was a little out of line. That
was the same price I paid for Riven and Starcraft--which had teams of people
working for more than a year. Let's get real, Eric (et al).

So here's my free equivalent. Maybe not all the bells and whistles, but
the gyst is probably all there. I've not seen the original in action, just
the still images.

Eric got the idea from his friend at www.traipse.com. Lots of interesting
ideas on that site but strangely no source is available and emailing the
fellow doesn't help. In the spirit of sharing and generosity I'm making my
program available for enjoyment and tinkering.

Writing this program was a fun exercise. How do you model the world where
the balls can collide with obstacles and bounce off? Trying to do it
mathematically would be quite slow, where for each ball you'd have to check
if it is inside any of the rectangles and if so do the bounce.

The way I implemented it is probably the way Drew Olbrich did in his
version. Comparing the two I think Eric just added some pretty colors rather
than thin lines, and added sounds. Some other features like gravity wells and
whatnot--as I said not really a lot of work went into it.

I set up an array that corresponds to the dimensions of the virtual screen,
and all the rectangles are rendered into it as triangles like this:
aaaaaaaaaaaaaaaaaaaaaaa
baaaaaaaaaaaaaaaaaaaaac
bbaaaaaaaaaaaaaaaaaaacc
bbbaaaaaaaaaaaaaaaaaccc
bbbbaaaaaaaaaaaaaaacccc
bbbbbdddddddddddddccccc
bbbbdddddddddddddddcccc
bbbdddddddddddddddddccc
bbdddddddddddddddddddcc
bdddddddddddddddddddddc

It's a little more complicated but nevermind. In moving a ball, I check this
bitmap for a collision. If the location is zero, there was no collision. If
it is nonzero (as in a, b, c or d) I do a collision, and the number indexes
into an array telling the orientation of the triangle. I only do collisions
if the ball is moving towards the bumper, so I won't bounce an object inside
the rectangle trying to escape.

There is some limited color mixing. BTW to bring out a fountain or a
rectangle you've got to grab the center marker on the object in the upper left
area. To change the direction you've got to drag the off center marker. To
change the color of a fountain drag it down to the color markers on the bottom
left and it will take on the color touched. There is no way to delete fountains
or rectangles yet.

By hitting 'm' the fountains can blend their color. It's a complicated
problem and I'm not entirely satisfied with the results, but it is kind of
cool.

By hitting 's' the program will switch to drawing a spiral, which causes a
pretty slick effect if you stare into the center for a while, then look at
something else. Hitting escape goes back to the fountains.

By hitting 'a' the spiral is done with ants, which I thought might look neat.


Anyway have fun.
--Dave

Dave Ashley
13 June 1999
http://www.xdr.com/dash
