SimplePathXNA (SPX) was refactored out of my capstone project last semester. At that time, it was a very messy Visual Studio project that one could start with as a base for creating their own game. In that stage, SPX was used as the foundation for OGUR. Over the past three months extensive work has been done while expanding OGUR to enhance the usefulness of the SPX framework.

My fiancee and I are interested in working on a simple game during our spare time. In an effort to speed up the development of our prototype for that game, I have pulled a huge amount of updates to SPX from OGUR over the couse of the past twenty four hours. All of these updates are now pushed on the master repository stored at Github (link available on the Projects page). Additionally, a 32 bit DLL of the library is now available for download.

On top of all of that, the SPXDemo has been re-written to use the new DLL instead of being coupled to the SPX project. A new tutorial will be coming once I have a few extra moments later this week.

 

The basic functionality of Bombard360 is finished to the point of what is due for my coursework. Now that I basically need to freeze the repo until classes are over (for grading purposes) I used the free time available to abstract out a lot of the code from Bombard360 into an easy to use framework for other 2D games.

This new framework can be found at this GitHub repo.

To get a feel for how the framework is used, try the following to add a new element to the game.

  1. Draw a new sprite in the next open open row of “SimplePathXna\SimplePathXnaContent\GameplaySheet.png”
  2. In the VS2010 solution, add a new element to the SpriteType (\Sprites\SpriteType.cs) enum that described the object you want to add to the game
  3. Add a new dictionary entry defining the contents of the sprite to SpriteSheetManager (\Sprites\SpriteSheetManager.cs)
  4. Create a new class that inherits GameplayObject (\GameObjects\GameplayObject.cs). In the constructor, pass the location and SpriteType into the protected Initialize method. This will handle most of the graphical setup for the class.
  5. Create a method within your new class with the following signature: public override void Update();, and define the object’s game logic here.
  6. In GameplayObjectFactory (\Factory\GameplayObjectFactory.cs), add a new case to the switch statement that defines the way your new object shall be created
  7. In GameplayState (\States\GameplayState.cs), call the function Add(GameplayObjectFactory.Create(400,400,SpriteType.YOUR_NEW_SPRITE_TYPE)); in the constructor
  8. Run the application, and an instance of your new object should show up on screen at 400,400. If not, then there’s a good chance that a null exception will be thrown before the game can launch, showing you what step you missed in setting the object up.

The benefits I’m finding from using this growing framework is the topic of a future post, but feel free to shoot me an e-mail if there are any problems encountered in getting setup with the project.

© 2012 Simple Path Studios Suffusion theme by Sayontan Sinha