Games in C with Source Code
Assembler for 0x10C
The forthcoming game ox10c will feature a 16 bit processor. The spec for the assembler and machine language has been published and assemblers are starting to appear. This is one in C.
C++ Robots Game Server VT100 Terminal Server
This is actually written in C and compiled with GNU C++, and is a game engine for C++ Robots written by Richard Rognlie. It's not playable as such but would make a good basis to build on.
Castle Viewer In C
This is a simple castle/dungeon type exploration program. Nothing fancy in under 450 lines of code! If you like experimenting with C, this is an easy program to experiment with.
Classic Empire - A turn Based Wargame
Classic Empire is a real time, multi-player, Internet-based game, featuring military, diplomatic, and economic goals. Empire is a game that is played against human opponents over a computer network, usually the Internet. It is possible for a game to last from a few hours to many months.
Corewars Original Mars Simulator
Core War/Core Wars is a programming game in which two or more programs called warriors" compete for the control of the Memory Array Redcode Simulator (MARS), a virtual computer. These programs are written in an abstract assembly language called Redcode. The object:stop all opposing program's processes. MARS is written in K&R C.
Crossword Maker by Robert Morris
This generates (well tries to) a crossword grid in the American style. You need to add words and the links in the readme file are no longer relevant so use a site like Mike Wiolfberg's scrabble Lists.
Doom Source Code
The sourc code to Doom has been ported to many platforms and exists in several different ports. The link goes to the Wikipedia page with information on the various Doom source ports.
EA GPL Software
The game publisher EA (Electronic Arts) has released source code under the GPL license. Currently these include EADM, EA Link, Rupture Desktop, NFS World Online, Sims 3 and Skate 3.
Eathena - Game server and emulator for an online game
Eathena was originally created as an emulator for the game Ragnarok Online. However it's now used for it's own games. It's cross platform, and can be set to run on Windows or Linux and can use flat file or MySQL. Note the sourceforge download does not include the source folder but you can browse and fetch it with svn
This is modified source code by Fabien Sanglard who has written a tear down of Duke Nukem 3D. You need the game data files to play.
Freeciv - Free, Open Source Civilization
Freeciv is a Free and Open Source empire-building strategy game inspired by the history of human civilization and the Sid Meiers (published by Microprose now FirAxis) game Civilization. The game commences in prehistory and your mission is to lead your tribe from the stone age to the space age...
FreeSpace Source Code Project
A commercial failure, FreeSpace 2, a space combat simulation had its source code released in 2002 and the FreeSpace Source Code Project was born. Several conversions have been released and development still continues through volunteers. Note a full copy of the game (details available at the link) is needed but can be bought for $6.00.
Frotz - Interactive Fiction Interpreter
Frotz is a multi-platform interpreter for Infocom games and other Z-machine games written by Stefan Jokisch in 1995-1997. the current version is for Unix but there are ports to other platforms. It plays all Z-code games, has config files. and is GPL Licensed.
Haaf's Game Engine - Hardware Accelerated 2D Games ENgine
HGE is an easy to use yet powerful hardware accelerated 2D game engine. It is a full featured middleware for developing commercial quality 2D games rapidly and easily. It covers all imaginable 2D game genres: from a simple puzzle to advanced multilayered platformer or strategy without even thinking of any non game logic code! It does not require knowledge of "window messages", DirectX programming and all that stuff. Note this has been ported for Mac/Linux to hge-unix.
Heretic and Hexen Source code
In the mid 90s both games were best sellers and now the source code has been released under GPL. This does not include the DMX Sound library or the graphics for the game.
Lariad - Cross platform Space Adventure
Lariad is an exploration based action/adventure game for Windows, Linux, and Mac OS X. The protagonist is a swamp dweller who lives peacefully on his wetland planet, all by himself. To recover a stolen item he must travel to distant, exotic planets, explore beautiful locales: a waterworld, ancient ruins, an abandoned industrial zone, and many more. Fight deadly monsters: venomous spiders, bats, overgrown wasps, and hostile humanoids and solve puzzles
Lil - a small scripting language
LIL (Little Interpreted Language) is a small C library in just a pair of .c and .h files which provide a compact yet very dynamic scripting language inspired by Tcl and the UNIX shell. LIL can be used in a wide range of situations, from simple configuration files to full extendability via scripting. There is some C99 so users of Microsoft's C/C++ compilers can obtain a public domain stdint.h implementation for their compiler from stdint.h).
MAME- Multiple Arcade Machine Emulator
When used in conjunction with an arcade game's data files (ROMs, CHDs, samples, etc.), MAME attempts to reproduce that game as faithfully as possible on a more modern general-purpose system. MAME can currently emulate many thousands of classic arcade video games from the the very earliest CPU-based systems to much more modern 3D platforms.
Multiple Emulator Super System - Home Computer Emulation
MESS is an acronym that stands for Multiple Emulator Super System. MESS will more or less faithfully reproduce computer and console systems on a PC. MESS can currently emulate over 250 systems from the last 5 decades. MESS is a sister project to MAME and shares some of the codebase.
NAEV - 2D Space Trading Game
NAEV is played from a top-down perspective, featuring fast-paced combat, many ships and outfits, and a large galaxy to explore. The game is highly open-ended, letting players proceed at their own paces. It's cross-platform for Mac, Linux and Windows.
Nethack - Slashing and Hacking in Dungeons for 21 years
Nethack is a single-player computer game originally released in 1987. It is a descendant of an earlier game called Hack (1985), which is a descendant of Rogue (1980). The "hack" part of the name refers to a genre of role-playing games known as hack and slash for their focus on combat. The player's character is in search of the Amulet of Yendor.
OOlit - Open Source cross platform Elite
This is a pretty accurate similar looking game to the Elite Space Trading game that came out in 1984.
Open Source Physics Engine
ODE is an open source, high performance library for simulating rigid body dynamics. It is fully featured, stable, mature and platform independent with an easy to use C/C++ API.
Role Play Dungeon Level Map and Contents Generator
Full C and C++ Source Code for a Windows application for generating Role Playing game maps for dungeons.
Simon Tatham's Filigrams
Filigrams are a type of pretty pictures generated by mathematical means and devised by Simon Tatham. They're not technically a type of fractal, although they contain elements which people who know fractals might find hauntingly familiar.
Space Tyrant - A Multi-Threaded Space Game Server
Space Tyrant is a multi-threaded Game Socket (telnet) Server in C. With ports, planets, starbases, trading posts, spaceports and other players. It's just one large C file, nearly 10,000 lines long.
VICE - CBM - compiler Emulator
VICE is an emulator collection which emulates the C64, the C128, the VIC20, almost all PET models, the PLUS4 and the CBM-II (aka C610). It runs on Unix, MS-DOS, Win32, OS/2, Acorn RISC OS, BeOS, QNX 6.x, Amiga, GP2X or Mac OS X machines.
Wolfenstein Source Code
This is the source code released under GPL and does not include the graphics or sounds for Wolfenstein: Enemy Territory, Return to Castle Wolfenstein single player, and Return to Castle Wolfenstein multiplayer. Note the link is to an FTP site though most browsers handle it ok.