Project 28 of 35  ·  Scratch Programming  ·  Module 2
Module 2

Clone Wars

Use Scratch cloning to build a space invaders style shoot-em-up game.

🍓  Open on Raspberry Pi Projects  ↗ Opens the official Raspberry Pi Foundation project — includes starter files and full step-by-step guide

What You Will Build

Use Scratch cloning to build a space invaders style shoot-em-up game. Follow the guide below to build the project, then open the official Raspberry Pi page for starter files, worked examples and extra help.

🍓 This project is on the Raspberry Pi Foundation website. Click the orange button above to access the full guide, starter Scratch project and extension activities on projects.raspberrypi.org.

What You Will Learn

  • Use create clone of to spawn multiple enemy ships
  • Make enemy clones descend and despawn when they reach the bottom
  • Clone laser sprites upward when the player shoots
  • Detect laser-enemy collisions to destroy both clones
  • Add progressive waves with more enemies each round

Step-by-Step Guide

  • 1Create a space backdrop.
  • 2Add a player spaceship sprite at the bottom.
  • 3Add an enemy ship sprite. On start: repeat 8create clone, each at a random x, y:120.
  • 4Each enemy clone: foreverchange y by -1. If y < -160: change lives by -1, delete this clone.
  • 5Player: left/right arrow keys move x. Spacebar: create laser clone.
  • 6Laser clone: change y by 8. If touching edge: delete clone.
  • 7If laser touching [enemy]: delete laser clone, delete enemy clone, score +1.
  • 8When all enemy clones are deleted: broadcast [next wave].
  • 9On next wave: increase number of spawned enemies by 2 for each wave. Track wave variable.
  • 10After wave 3: spawn a boss enemy that takes 5 hits.

Extension Challenges

Finished the main project? Push further:

  • Add different enemy types: some zigzag, some shoot back at the player.
  • Add player power-ups that drop from defeated enemies.
  • Add a scrolling starfield background using pen or backdrop switching.