Tuesday, March 2, 2010

Game state management, particle systems, and segment painting

Since I last checked in, I decided to add two things to the game that I already had working in my previous game attempt: particle systems and game state management. Both of these systems I borrowed from samples available from the official XNA web site. I like the way they are done and they are easy to expand from to fit the needs of the game. I built a simple but effective cutscene system off of the game state manager where you simply put the art and sound files in a folder with a name that is a number (like 0, 1, 2, etc.) and you can reference it that way to load and run it in the game. It simply displays the art and plays the sound file one at a time as the user hits the continue button. The video doesn't have sound but you get the idea. In the future I might expand this further to include a script file to make things more robust. The last, and most difficult, feature I added was to the map editor. I had come to realize that it is very difficult and annoying to keep having to line the segments up perfectly and repeatedly when I want to use them repeatedly for a scene. I decided to create a paintbrush like functionality where if I click and drag a segment, it will paint it repeatedly, side by side, or one on top of another, depending on which way I move the cursor. Implementing this functionality caused all sorts of bugs due to the simple way I implemented segment adding and manipulation. I went through and reworked the whole system to be more usable and work in harmony with the new painting feature.



This video shows off the segment painting functionality where I create a new sample map to test the new features with.








I script 3 tiles. The first scripted tile will cause an explosion as long as I stand on it. The second will trigger a cutscene that is just some stock images that come with Windows XP, then removes the scripts from itself so it wont play the cutscene again. The third causes an explosion and shoots the player into the air.



No comments:

Post a Comment