nV@derz! (nvaderz) 1.0 Design Document (v1.3)
(c) 2006-2013 Eric Pellegrin

by pellea72 (SourceForge.net user name)
This version dated April 2, 2009 (updated July 7, 2013)
First version dated September 12, 2006

I. About the Game
	nV@derz! is a two-dimensional, top-down space shooter inspired by the classic arcade game Space Invaders. As in the original, the player must defend the planet from waves of aliens, destroying them to progress to increasingly difficult levels, before either they reach the ground or they destroy all the player's defense guns.



II. General Features

	A. Presentation

		1. Title
			The name of the game is "nV@derz!", but "nvaderz" is used as a file name and in Web text fields where the "@" symbol would cause problems.

		2. Documentation
			The game will be accompanied by full HTML, and possibly PDF, documentation. The style will emulate the booklets that accompany commercial computer and console games.

		3. "Package Art"
			The game release will feature extra packaging art such as CD case insert graphics, CD/DVD sticker art, and a desktop/screen saver image.


	B. Interface

		1. Splash screen
			Display game illustration while loading resources, then switch to the main menu.

		2. Main Menu
			Allow the user to start the game, adjust settings, view high scores, view credits, or quit.

		3. Settings
			The player can choose a one or two-player game, keyboard or joystick input, which keys or buttons perform certain actions, fullscreen (if supported) or windowed mode, and adjust sound settings.

		4. Game Screen
			The active game area takes up most of the screen, with the exception of a rectangular area across the bottom of the screen, "the ground", where status information like number of lives left, or special game modes, can be displayed. Points will be displayed along the top of the screen, player one on the left and player two (if applicable) on the right. I'm undecided on whether the "top of the screen" ends below or above the score, as far as things coming into or going off screen.


	C. Game-play

		1. Players
			A player operates a cannon that moves horizontally along a ground base at the bottom of the screen. The cannon stops at the left and right limits of the screen. There is no wrap-around. The player can fire a laser that travels upward in a straight line until it hits something or goes off the top of the screen. In normal firing mode, the player may not fire another shot while the last one is still active.

			If there are two players, both players have full run of the bottom of the play area, overlapping when they cross each other. The players will take turns being "on top" for purposes of taking hits from invaders, as only one player will be destroyed by any alien laser.

		2. Non-players

			a. Invaders
				Each level will begin with a horde of invaders, seven members across and five members deep. A row will consist of the same invader all the way across, but each row will feature a different invader. The invaders move as a group across the screen  as far as it can go, then drops down a step and moves across to the other side of the screen, until the group reaches the bottom of the screen or until all the invaders are destroyed by the player(s). The horde moves faster as more of its invaders are killed.

				Invaders can fire lasers that travel downward in a straight line until they hit something. Only the bottom-most invader in each column may fire a laser, and that invader (or any other in the same column if that invader is killed) may not fire another shot while a laser for that column is still active.

			b. Shield
				The player shield is a horizontal band between the player(s) and the invaders that presents an obstacle to both player and invader fire, which upon contact blasts a hole in the shield. The shield may not be repaired and must last the player for the duration of the game. When it's gone, it's gone. If there are two players, they share control of the shield.
				The shield is off by default, but can be activated by holding a particular button or control (e.g. pulling back on the joystick). Shield control is not toggled, so it will remain active only as long as the player is holding the control in place. If there are two players, the shield will remain active as long as either one or both of the players holds the shield control.

			c. Heads-Up Display (HUD)
				A panel of indicators along with sound alerts will allow the player(s) to keep up with the score, the number of lives left, and the various changes in game state (bonuses achieved, etc.).

		3. Objective
			The object is to destroy all the invaders in a level and advance to the next level. To do this the player(s) must try to avoid being shot by enemy fire and to prevent the invaders from reaching the ground. The game is over when either the invaders reach the bottom, or all players have lost all their cannons (lives).

		4. Controls
			The player(s) can play with the keyboard and/or a joystick if it is compatible with the operating system and the Allegro game library. If a two player game, both may use keyboard or joysticks, or one may use a keyboard and the other a joystick.

		5. Scoring
			The player receives points for each invader shot, based on which row the invader occupies: the higher the row, the more points awarded. The player may also receive points for shooting bonus objects that appear throughout the game.

		6. Bonuses
			Bonuses are extra game elements intended to provide greater challenge or excitement. They usually, but not always, come in the way of some kind of falling capsule that must be activated by catching them (collision) or by shooting them. Bonus powers are usually temporary, lasting about ten to twenty seconds, or so.

			a. Player

				(1) One-way shield
					This shield stops enemy fire, but allows player fire to pass through. It operates in the same space as the regular shield, but does not have any holes and does not require any action by the player to remain activated. In fact, activating the regular shield has no effect while the One-way shield is present. It is a temporary power and is activated by the player shooting a capsule. If there are two players, both benefit from this bonus.

				(2) Guided missiles
					This allows player to guide the shot by continuing to hold the fire button after shooting, causing the laser to follow the movement of the player. This temporary power would be activated by shooting a bonus capsule. If two players, only the player who activates the bonus will benefit, although both players can have this power if they each shoot a separate bonus capsule.

				(3) Repeat fire
					This bonus allows the player up to three active shots at a time instead of one. This means that there can be as many as three player shots on the screen at any time. When any of the shots go off the screen or hit something, the player can fire again until the total reaches three. This is a temporary power activated by shooting a bonus capsule. If two players, only the player who activates the bonus will benefit, although both players can have this power if they each shoot a separate bonus capsule.

				*** Note ***
					The above three powers are concurrent, so that a player can have more than one active at the same time. For example, if a player has both guided missiles and repeat fire, each of the player's three shots can be guided (they would be affected together). Also note that there is no way to know what kind of bonus a capsule contains until after it is activated.

				(4) Extra ship/cannon
					Extra lives will be awarded when the player reaches certain score milestones.

			b. Invaders

				(1) Impact artillery
					These are missiles that fall from the sky and explode when they hit the ground, a shield or the player. The explosion affects a certain radius around the point of impact, so the player must avoid both a direct hit and being too near the impact zone. The player can deactivate the mortar by shooting it. If the mortar hits a shield, it causes considerably greater damage than a laser would.

				(2) Super invaders
					A Super Invader requires more than one shot to destroy. There are two- and three-shot Super Invaders distinguished by color. When the player shoots a three-shot invader, it changes to the color of a two-shot invader, and then to a regular invader when shot again. Super Invaders, when they appear, begin a level already in place in the horde, and occur with greater frequency and with greater strength as the levels increase.

				(3) Cloak shield
					When the cloak shield is activated, the horde of invaders becomes invisible, while continuing to attack as usual. The shield only cloaks invaders, not their laser fire. The player can still track the location of invaders by watching where lasers originate. While cloaked, an invader will flash on and off when hit by a player laser.

					The cloak shield is activated when its missile collides with the ground, a player cannon, or the player shield, but not by colliding with an invader. The player may shoot the missile to prevent its activation. The cloak shield is a temporary bonus.

				*** Note ***
					The missile that delivers the invader bonuses is distinguishable from player bonus capsules in that it has a different shape, and it moves more quickly following a definite trajectory towards the ground, while the capsule moves more slowly and floats down. However, like the capsule, the type of bonus a missile delivers cannot be determined before it is activated.

		7. Levels
			The levels will become increasingly more challenging throughout the game, accomplished with faster moving invaders, an increase in invader laser fire, greater frequency of enemy bonuses, and starting levels with Super Invaders. Advanced levels will also feature more frequent player bonuses as well.

		8. Endgame
			If the game ends due to invaders reaching the bottom of the screen, or all players running out of lives, the game will check to see if any player has topped a high score and, if so, prompt for a name and store the new score. Afterwards, or if no high score is made, the player is returned to the main menu.

			If the game ends due to the player hitting the reset key/button, the game will go directly to the main menu.


	D. Graphics
		The art style will be reminiscent of 1980s space arcade games.


	E. Sound
		The audio will be reminiscent of 1980s arcade games. The soundtrack will consist of background music, firing sounds, explosions, and special sounds or melodies to indicate the various bonus modes or the presence of certain items or conditions.



III. Technical Features

	A. Development

		1. Tools
			The game will be developed using the C programming language, the gcc compiler, the Allegro game library, Inkscape scalable vector graphics program, and the Audacity sound editor. The primary development environment is currently Fedora 10 Linux (PowerPC) on a PowerMac G5. An old Pentium III running Debian Linux is used for x86 builds and testing. Development is done on the command line using the bash shell and the Make build system. Source code is written with the vim text editor. Xcode and other Apple Developer Tools may ultimately be used to create a Mac application version of the game.

		2. Goals
			The goals of this project are to learn and improve my skills in game and software development as well as the tools involved, to share both the process and the resulting products with others so they can benefit from them, and to create a game that I will enjoy playing and that hopefully others will enjoy too. The following points will be kept in mind:
			a. Try to limit code dependencies to the Allegro and C standard libraries. I don't want someone to have to be a code guru to compile the game or have to run around the Net searching for libraries and having to install them. The pthread library may also need to be used, but I'll try to avoid it.

			b. Use tools that are open and freely available on a variety of platforms so that no one feels left out from accessing the project files. Any already-existing graphics or audio should be licensed in a way that people can modify them or use them for other projects.


	B. Cross-platform
		The use of free and open tools will allow the game to be compiled on most modern systems.

		1. Binary release
			Currently, binaries for Linux on 32bit i686 systems are being developed. However binaries for Linux and Macintosh on PowerPC as well as Windows systems have been released in the past and may be released in the future. For platforms where binaries are not available, users are free to compile nV@derz! from source code, which is freely available.

		2. Source release
			All source code, game resources, and project files for those resources will be released for users to study, modify and share as they see fit within the boundaries of the accompanying licenses.


	C. System requirements

		The game is currently developed on a dual core (1.0 GHz each) netbook with 2GB RAM, but actual requirements should be even less than this. Earlier versions of the game have been tested on a 500 MHz Pentium III without any major problems.


	D. License

		The source code will be released under GNU General Public License. Game resources will be under a Creative Commons license.
