Introduction to Programming

Activity 1: Setting Up the Stage

Lesson 10: Space Battle Game

Get ready for an exciting project — we are going to build a Space Battle Game! Over the next few activities, we will create a game where a rocketship battles ghosts in space. In this first activity, we will set up the Stage with a space backdrop and add our main sprites.

PictoBlox stage showing a space backdrop with a rocketship sprite at the bottom and ghost sprites floating around

Setting Up the Backdrop

  • Open PictoBlox and create a New File.
  • Select Block Coding as the coding environment.
  • Click the Stage and go to the Backdrops tab.
  • Choose a space-themed backdrop from the backdrop library (e.g. Stars or Space).
  • Your Stage should now look like outer space!

Adding the Sprites

  • Delete the default sprite.
  • Add a Rocketship sprite from the sprite library — this will be the player's ship.
  • Add a Ghost sprite from the sprite library — this will be the enemy.
  • Position the rocketship at the bottom center of the Stage.
  • Position the ghost somewhere in the upper half of the Stage.
PictoBlox stage showing a dark space backdrop with a rocketship at the bottom and a ghost sprite near the top

Setting Up the Score

  • Go to the Variables palette and create a variable called Score.
  • Create another variable called Lives.
  • Add a 'When flag clicked' script to the Stage that sets Score to 0 and Lives to 3.
  • Make sure both variables are visible on the Stage.
Block coding script on the Stage showing when flag clicked, set Score to 0, set Lives to 3

Resizing the Sprites

  • Select the Rocketship sprite and set its size to around 50% using the size field below the Stage.
  • Select the Ghost sprite and set its size to around 60%.
  • Make sure both sprites look proportional on the Stage.
Save your file with the name Space Battle Game before moving on to Activity 2!

Subscribe to our newsletter.

Get updates to news and events.