7 Move and shoot

This chapter covers

  • How the NES handles player objects (sprites)
  • Defining patterns for our player and bullet
  • Controlling the timing of movement and gameplay
  • Getting objects moving on the screen
  • Testing the gamepad direction and moving the player’s ship left or right
  • Testing the gamepad fire button and placing a bullet on the screen
  • Moving the current player’s bullet up the screen

In the last chapter, we drew our background graphics for both the title screen and the main game screen. In this chapter, we can look at how you display the player objects onscreen using special objects provided by the NES hardware called sprites.

We will use the sprites to display our player’s ship onscreen and allow the player to move it left and ...

Get Classic Game Programming on the NES now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.