Building the player

We are going to start by building our player object. We have briefly described the design already, but we have not broken the design down into something that we can start creating. First, we should bullet point each feature and what it entails to ensure we have all the Variables and Events we will need.

  • Arrow keys will move the player around the play area
    • Must remain in play area
  • Spacebar will fire weapon
    • A single bullet fired with each button press
  • Colliding with bullets or enemies causes damage
    • Should be different values based on type

Setting up the player sprite

Let's create the player sprite and prepare it for the game:

  1. Create a new project and call it Chapter_03.
  2. Create a new Sprite and name it spr_Player.
  3. Click on Load Sprite ...

Get HTML5 Game Development with GameMaker now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.