Coding Christmas Fun! By James Abela Scratch is a great platform for primary pupils for learning to code, but also for secondary children in honing their skills before moving to text based languages. There are lots of great games on Scratch, but in this festive season it is nice to make a game with a little code that everybody can enjoy, remix and share. The full game and code can be found at bit.ly/uked14dec04 To make your own game you will need two Sprites, an elf and a snowball. It is also nice to choose a festive background. You will also need to make three variables: aim, lives and speed. See the ‘Data’ column to make variables for all sprites.
The Elf’s Code
The elf sprite needs three blocks of code.
1. This code sets up the game and then handles the jump code. Point out to students that ‘forever’ is repetition. 2. The second block of code enables the Sprite to duck. You will need two costumes for this. ‘elf2’ is the standing costume and ‘elf3’ is when he is ducked.
06 UKED Magazine
3. You need code to handle the lives. It is important to ensure that the backdrop is setup at the beginning of the game and in many Scratch games you need a delay to ensure that lives are not taken off right at the beginning of the game. When lives reach 0 the game displays a Game Over backdrop.
December issue of UKED Magazine - Festive theme