6 Starting a game

This chapter covers

  • Setting up our game project
  • Creating a shared library
  • Initializing the console
  • How the NES displays background graphics
  • Displaying the graphics on both our title screen and the main screen of the game

In this chapter, we are going to start making our game, called Mega Blast. This game is based on the Intellivision game Astro Smash, a simple space shooting game with our “hero” ship down at the bottom of the screen and various “enemies” dropping down toward the bottom of the screen (see figure 6.1).

Figure 6.1 Astro Smash on the Intellivision

Why a space shooting game, you may ask? This type of game has simple-to-understand gameplay elements. These will allow us to cover several common game mechanics, such as object movement, animation, and collision detection, and then move on to more advanced topics such as sound effects and music.

6.1 Setting up our game project

As we start to put together our game, we need to set up the various support files that will make up our project. This will allow us to build and test our code as we go. This will mostly be the code we have covered in the previous chapter with some modifications to suit our game, but we will go through the differences.

6.1.1 Memory configuration

6.1.2 Compiling script

6.2 Creating a code library

6.3 Adding some macros

6.4 Initializing the console

6.5 NES background graphics

6.5.1 Tile name tables

6.5.2 Tile patterns

6.6 Defining the tile set

6.7 Displaying the title screen

6.8 Displaying the game screen

Summary