NOGDUS

Articles, Tutorials, and other things. => General Game Programming => Topic started by: Richard Marks on March 09, 2009, 07:01:22 PM



Title: Project Templates
Post by: Richard Marks on March 09, 2009, 07:01:22 PM
Project Templates

Want to get started working on a project really fast?
I'm going to be creating startup projects for the Code::Blocks IDE (http://www.codeblocks.org/downloads) and making them available here.

How to Install and Use User Templates
On Linux:
Extract the archive you down to the /home/username/.codeblocks/UserTemplates/ directory.
Pick User Templates when creating a new project in Code::Blocks.
You should see the template you just installed.

On Windows:
...not sure yet.. I'll get back to you.. 8)


Title: Re: Project Templates
Post by: Richard Marks on March 09, 2009, 07:14:42 PM
SDLGameProject
A user template for starting a simple game based on SDL.
The project depends on SDL (http://www.libsdl.org/download-1.2.php), SDL_image (http://www.libsdl.org/projects/SDL_image/), and SConS (http://www.scons.org/download.php) to be built, and should build without any trouble in Code::Blocks.
The code is OOP organized and documented using Doxygen (http://www.stack.nl/~dimitri/doxygen/)-compatible comments.
The project will open an 800x600 window and simple clear it black.
There is code for handling the W,S,A,D, and arrow keys in a game-oriented manner.
Code:
if (motionButtonDown[MOTIONBUTTON_UP])
{
// the UP arrow or W key is currently down
}

The following "motion button constants" are defined:

MOTIONBUTTON_UP, MOTIONBUTTON_DOWN, MOTIONBUTTON_LEFT, MOTIONBUTTON_RIGHT

Download SDL Game Project User Template for Code::Blocks 8.02 (http://www.ccpssolutions.com/project_templates/codeblocks/SDLGameProject.tar.gz)
License: Feel free to use this project code as you wish, just do not re-distribute the template as your own.


Title: Re: Project Templates
Post by: Richard Marks on March 20, 2009, 01:37:57 PM
AllegroGameProject
A user template for starting a simple game based on Allegro. (I ported the SDLGameProject Template to Allegro)
The project depends on Allegro (http://www.allegro.cc) version 4.2.x, and SConS (http://www.scons.org/download.php) to be built, and should build without any trouble in Code::Blocks.
The code is OOP organized and documented using Doxygen (http://www.stack.nl/~dimitri/doxygen/)-compatible comments.
The project will open an 800x600 window and simple clear it black.
There is code for handling the W,S,A,D, and arrow keys, as well as code to show how to handle individual mouse-clicks.
There is code for handling closing the window via the [X] button, and also FPS locking for CPU independent timing!

Download Allegro Game Project User Template for Code::Blocks 8.02 (http://www.ccpssolutions.com/project_templates/codeblocks/AllegroGameProject.tar.gz)
License: Feel free to use this project code as you wish, just do not re-distribute the template as your own.

If you downloaded this template and the ESC keys and stuff didn't work, its because I screwed up and forgot something important!
I've updated the archive for downloading with the missing code.