Notes on "founts" ---------------------------------------------------------------------- 1. Instructions. Usage: founts or founts NUMBER where NUMBER specifies a screen width from 100 to 2048. Note: The de- fault width is 640. Keyboard commands [after startup]: c Change background colors e Eye demo f New fractal background h Hide/unhide the non-ball objects m Turn on/off mixing p Pause movement r Rotate hoses s Spiral pattern (escape to exit) x Delete everything 1-9 Load preset shift 1-9 Store preset To change the color of a fountain, drag it over the color-selector balls near the bottom of the screen. ---------------------------------------------------------------------- 2. Developer's notes. This is my founts demo/program which was inspired by Eric's Cascade... Maybe not all the bells and whistles, but the [gist] 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 inter- esting ideas on that site but strangely no source is available and emailing the fellow doesn't help. In the spirit of sharing and gener- osity 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 bump- er, 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 touch- ed. 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 fount- ains. 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