Submitted by , posted on 18 March 2003



Image Description, by


This was written for the LGP devcompany competition http://www.linuxgamepublishing.com/devcompany.php. In short, linuxgamepublishing wanted a team of 8 developpers to create a Linux game (potentially cross-platform also) for which they guaranteed publishing. One part of the application was "to do soemthing cool in no more then 2K". This is a really odd thing since the 2K actually refers to source code characters (excluding "\t\r\n "). Henceforth what you're looking at now is a falling snow demo written with SDL/OpenGL. Of course it looks better when it's animated, since it's written with SDL, Windows and Linux users alike may check out the link posted above in order to check it out (source code only).

On the technical side of things, the snowfall animation is done in a cpu speed independant fashion and is based on a random angle diffrenciation method. most old-school snow demos were simply doing a random positioning diffrence of the snowflake but this doesn't look too good since it doesn't do a smooth transition (ie: it can jump from x += [-10 to +10]). By using the angles as a diffrence, we can basically guarantee that the transition will be smooth since the angle can only change of so much per seconds. Besides the animation, the flake itself is a texture which is generated on the fly. I'm using a Korn fractal to generate the bounding pixels for the fractal and then, I use a floodfill algorithm to add transparency around the white flake. All of this is done with less 2000bytes. You can also take a look at the other finalist's sumissions at the web site. Some are pretty impressive considering the contraints.

Chris



[prev]
Image of the Day Gallery
www.flipcode.com

[next]


 


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.