www.NewsDownload.co.uk Page 9
Overview
Makefile
Common.hpp
Common.cpp
Asteroids.hpp
Asteroids.cpp
Number.hpp
Number.cpp
Text.hpp
Text.cpp
AstroRock.hpp
AstroRock.cpp
AstroShip.hpp
AstroShip.cpp
AstroShot.hpp
AstroShot.cpp
Astro_UFO.hpp
Astro_UFO.cpp
GNU License

Coding a Linux Game

2012-04-17 12:40 By Jason Birch

Penultimate in a series of how to code articles. Demonstrating coding an Asteroids Clone game with various technologies. This example using C++ and xWindows, implementing as an application on Linux operating systems.

In this article I have converted my Asteroids Clone code into a Linux xWindows application. I am now publishing the source code here under the GNU General Public License License as a series of articles describing how to write code using various technologies.

The code here can be freely distributed, but only on the condition that a credit to Jason Birch is maintained in the source code files and running application.

The source code is broken down into the classes which make the application, in the tabs on the left of this article. The tabs are placed in order from the simplest classes to the more complex classes last. There is a commentary accompanying each source code file explaining how the code operates.

A compiled version of the Linux application, compiled on CentOS 32bit, is available here, it is just 110KB in size.

Keys:
ESC - Exit Application, F1 - New Game, UP - Thrust, DOWN - Hyperspace, LEFT - Rotate Counter Clockwise, RIGHT - Rotate Clockwise, CTRL - Fire

Audio files can be downloaded here:
Belt.wav HyperSpace.wav Shot.wav UFO.wav
Credit.wav Rock.wav Thrust.wav UFOShot.wav


Screen Shot Of Linux Conversion

Required Environment
To run the application, a Linux operating system is required with xWindows installed. The source code should specifically be compiled for the version of the distribution of Linux it is to run on.

The following packages are required to compile and run the application:
yum install gcc
yum install gcc-c++
yum install libX11-devel
yum install alsa-lib-devel
yum install libsndfile-devel

Writing Code
To develop the application, any text editor can be used, such as gEdit.

Compiling Code
gcc and make are the best tools for compiling the source code.

Distributing Application
The application can be run on an xWindows Linux operating system. Compile the code specifically for the target operating system.

Running Application
The application can be run by double clicking on the application icon.

Loading...