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 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.