Project Approach

I took a very incremental approach to creating Q-Blizzard. My main goals were pretty high: learn a new framework in a manner of a few weeks, create a decent particle system, and throw in some extras along the way. In order to keep myself from going insane, I set small checkpoints for myself and finished functionality in extremely small chunks and built on top of it once tested.

The project really had three phases/spurts of development:

  1. Learning XNAThis part consisted of learning how to get the window set up, what exactly the XNA GraphicsDevice was, and how things are actually drawn onto the screen. At first I started with simple sprites using XNA’s Texture2D class and just moving them around. I also learned here how GameComponents work, and learned about the ‘lifecycle’ of elements inside of the XNA framework. Having a decent knowledge of how the framework manages objects and what methods it calls in succession (Initialize > LoadContent > Update > Draw > UnloadContent) is very important in building a well designed XNA game/app.
  2. Generating SnowNext I set about creating the particle system. I took very small steps here: at first I got just one particle to move down the screen, then I started to add in more. I realized here that I needed to cap the number of snowflakes generated and actually manage their own lifecycles. I also added plenty of attributes to each snowflake, including how fast they fall, their color, how much the wind effects them, and so on. I had to define just how the particle lifecycle occurs, which in my system each snowflake has 5 different states: Created, Falling, Fallen, Melting, and Melted. This allowed me to execute actions based on the state of the snowflake instead of worrying about different flags all over the place. At the end of this phase I had snow falling from the top of the screen to the bottom, and once they are at the bottom, they begin to melt (their alpha slowly turns to zero). Once melted, the snowflakes are essentially reset, and can be put back on the top of the screen to begin the process again.
  3. Making snow fall on the curveThe final phase of development created the snowy hill at the bottom of the scene. I also took an incremental approach to developing this portion as well. It started off with a horizontal line that the snow fell onto above the bottom of the screen. I then was playing around with randomly generating triangle primitives using the XNA GraphicsDevice, and I made the snow stick to the triangles. However, I decided that this was not realistic enough. I thought first to recursively subdivide the triangles like fractal terrain generation does, but instead I relied on creating a b-spline curve. Generating knots was the quite simple, and so was the actual b-spline algorithm which I modified from an existing source. Once the curve was generated, I made snow fall on the it, and then I made the curve into the top of the hill by creating triangles between the curve and the bottom of the screen.

Comments are closed.