Sample Code - IndieLib

IndieLib-Sample App

These projects demonstrate some of the features found in the IndieLib. Most if not all were used for prototyping various aspects of game play during development. The IndieLib is a good third party library for quick prototyping. IndieLib uses DirectX 9.0 under the hood as well as a few other dependent libraries.

You do not need to install the IndieLib SDK or any of the other dependent libraries in order to compile and run these samples. But if you plan to get deeper into the library it is suggested that you do install IndieLib at least. You can find it here.

All projects that include source code were created using Microsoft Visual Studio 2005 and 2008 project files.

Animation-Collision


This sample code demonstrates some basic features typically found in a 2D side side shooter game.

    Features:

  • side scrolling (single layer)
  • animation using individual images
  • collision detection and response using simple bounding areas
  • keyboard key movement



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Blend


This project uses blending with a time factor that applies a blend over time. Blends a highlight image over areas of a background images where "buttons" are located. The effect is to highlight the "button" when the mouse hovers over it. Uses circular bounding area for collision detection between the mouse cursor and "button" area.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Screen Transitions


This project enables transitions like fade and wipe effects between two textures. The inspiration for this project was from an HGE project that did the same thing. Run the app, hit the SPACE bar to transition using the next effect.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Fading between Images


This project enables really only one transition which is a fading between two textures. Run the app, hit Z and X keys to fade back and forth between them.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Firing Tank


This project is a little more interesting because it is modeled after the cool game Heavy Weapon Deluxe. The controls are the mouse for left and right movement and the left mouse button to fire. This demo is simplistic in that only one bullet can exist at a given time. There is another demo that keeps an array of bullets that are fired.

I incorporated an AudioManager class for sound loading and playing. A sound is played every time you fire a bullet. The manager class wraps FMOD made by Firelight Technologies which is a great audio library.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Tank Fires at Enemies


This project is even more interesting because you can fire at some enemies and they blow up with an explosion animation. Like another demo it is modeled after the cool game Heavy Weapon Deluxe. The controls are the mouse for left and right movement and the left mouse button to fire. The explosion animation is a photoshop hack so realize that it can be replaced with a much nicer set of graphics.

I incorporated an AudioManager class for sound loading and playing. A sound is played every time you fire a bullet. The manager class wraps FMOD made by Firelight Technologies which is a great audio library.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Parallax Scrolling


This project basically is the same as one of the samples you get with IndieLib SDK. The images are from the IndieLib too.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Tank Firing Enemies and Parallax Scrolling


This project demonstrates parallax scrolling, sprite movement that follows the mouse cursor and bullet firing. The images are from the IndieLib too. The little red half circle in the background image was a marker for me to know where the seam was between the tiled images.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

IndieLib and Pyro Particles


This project incorporates Pyro Particles by Fenomen Games. I included all of the sample particle effects that comes with the Pyro Particle editor The effects look washed out, though. There may be a way to set the blend mode correctly but in the IndieLib the blend mode is attached to an Entity and the particle effects are not entities. There may be a way around this but I did not spend any more time on this sample.

The Pyro Particle code was taken directly from their samples with no modifications.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Floating text


Click the left mouse and watch the mouse X value float up and fade away. This demo uses a custom made font called army_05 which came from a font called "army" from dafont.com. The mudgefont program included with the IndieLib [IndieLib installed location]\IndieLib\IndieLib_Tools\Mudge Font 1.0 For IndieLib\mudFont.exe was used to create the font. PhotoShop was then used to clean up the tga and ultimately saved as a png because of the transparent background.

You can open the army.fnt in mudFont.exe to view or change the settings. NOTE: This font I chose only has uppercase letters but I still needed to include the lower case ones in mudFont.exe so they would show up.

Caveat: This demo isn't perfect. You need to wait for the current floating text to disappear before it allows you to click/create a new one. It was faster to do it that way so I wouldn't have to manage multiple objects.



IndieLib-Sample App

Download (Binaries and source code - C++ DirectX 9.x Visual Studio 2005 and Visual Studio 2008)

Stay tuned...


More to come! ...