>Intro to Scratch

Learning the basics of Scratch coding to introduce the Progress Outcomes of the DTHM Curriculum


I find it really amusing when I ask the question 'Has anyone ever used Scratch before?' One or two students have dabbled with it but most of the students in class have had no experience at all. Typically, I get the hands of the boys in my class enthusiastically and confidently shooting up. I then proceed to show the class how to make this simple game only to then find that the boys actually have no idea how to use various elements such as Variables and Operators.

On the other hand, the girls are quietly working away to grasp the ideas and invariably are better at learning how to code. It's then that the same boys realise that what they are good at is being good 'consumers' of technology but are not so good at being good 'creators' using technology. It's moments like that which make me realise the importance of starting with something as 'simple' as Scratch. These moments also make me realise why I will continue to love teaching the new DTHM curriculum... The following lesson is an example of how I introduce basic coding elements to my students.

Scratch Game: Dog Chases Cat 

I am a great fan of allowing students to have a choice in their work. The objective of this lesson is for the students to develop their Computational Thinking or Digital Outcome skills by creating a basic game that can be adapted as the students go along.

The students will learn how to do the following things:

  • Move a character up, down, left and right on the screen
  • Chase another character (automatic movement)
  • Multiply (clone) a character
  • Use variables to create a timer and high score

Although I have called this game Dog Chases Cat, the students are allowed to make this game with any two characters of their choice.

Screen Layout

I would normally start by introducing what the overall purpose of the different blocks of code are. I would also talk about costumes, sounds, sprites and stages (backdrops) and where to find the things that the students will commonly use. 

It is important for the students to also understand the coordinates of the screen 

Character movement

Although there are several ways to get a character or sprite to move around the screen, I think the example below is the best way to do this as it allows your character to move up, down, left and right as well as facilitating diagonal movement without writing any extra code. 

This could be adapted for any two player game that needs user control by swapping up, down, left and right in the above code to the letters W, A, S and D.

New Character movement

Automatic character movement is great for one player. The code below achieves this. 

Cloning

To add to the game difficulty, cloning can be introduced to the character doing the chasing.  

Here is an example of what it looks like when the dog is cloned.

Creating a Timer

This is where Variables are introduced to the game. The 'Timer' block is also utilized. 

Creating a Best Time score

The high score or 'Best Time' is great for the competition element of the game

Creating a start screen

A simple start screen can be used to make the game a more user friendly experience. 

Where to from here?

A follow-up lesson could be to expand on the concepts and principles of coding that they have learned previously by creating a Cat Maze game. In this lesson the students will complete the following:

  • Move a character up, down, left and right on your screen
  • Have a character return to the start when it hits the side of the maze
  • Have a character move to the next screen (level)
  • Use variables to create a scoring system

This and other similar games could also be expanded upon by using a Makey Makey electronic peripheral to control your game.