EGG - the Explosion Graphics Generator

This is a simple scripting language for implementing particle system graphics effects, which I wrote in September 1998, updated in June 1999 to work under Windows using MSVC, and updated again in July 1999 to work under Linux. It is not at all optimised and therefore runs quite slowly, so it isn't suitable for realtime use, but it may be useful for making prerendered animations, as a testbed for designing effects that you will later reimplement in more efficient native C code, or as a library that can be linked into your program and used to generate some graphics when the program initialises.

It also contains what is IMHO a rather nifty expression evaluator, which you are very welcome to pinch if you ever need such a thing.

I chose the name EGG partly because that is an acronym for "Explosion Graphics Generator", but mostly because I've always wanted to have a type of file with a .egg extension :-)

This program is freeware. You may do anything you like with it.

egg.zip (27k)

(screenshots)


As an example of the script syntax, here is the burn.egg file which generated the bottom left of the above images:

   #  Example script for the EGG system, by Shawn Hargreaves.
   #
   #  This is a fire effect, similar to the Allegro ex11 program. The hotspot
   #  particles move randomly across the bottom of the screen, creating a
   #  constant stream of flame particles, which move upwards and gradually
   #  fade out.


   type flame
   {
      size := 20;
      aa := 1;

      r := 255;
      g := 200;
      b := 100;
      a := 128;

      r = r*0.92;
      g = g*0.88;
      b = b*0.85;

      y = y-2;

      x = x+(rand-0.5)*3;
      y = y+(rand-0.5)*3;

      if (y < -64) {
	 die; 
      }
   }


   type hotspot
   {
      size := 16;
      aa := 1;

      r := 100;
      g := 50;
      b := 0;

      y := 64;

      x = x+(rand-0.5)*10;

      if (x < -64) {
	 x = 64;
      }

      if (x > 64) {
	 x = -64;
      }

      lay flame { 
	 x = _x;
	 y = _y;
      }
   }


   lay (24) hotspot;
Back to my homepage