Hour of Scratch

Project Goals:

 Trail Blazer is a game where the player digs paths. The goal is to dig the longest path without hitting the edge or already dug paths. You will REMIX the Trail Blazer game to make the code your own by:
  • Changing sound code
  • Changing how your player moves
  • Changing how the player and background looks and animates
  • Changing how the game is scored

I Can:

  • Read code simple code
  • Remix existing code to add my own features


What is Coding?

Definition: Algorithm is a series of steps to complete a task or solve a problem

For example, ‘make icing’ is an algorithm we can call on again to make a cake, cookie, or cupcake

Definition: Sequence is an ordered series of steps. Computers read and perform commands in order from top to bottom


Trail Blazer

The game we will be Remixing today is based on the game Tron Light Cycle

Definition: Remixing is the act of taking someone else’s code and tweaking the code.

Trail Blazer is a game where the player digs paths. The goal is to dig the longest path without hitting the edge or tunnels you have already dug. See how long you can last!!

To play, use the arrow keys to change the direction of your Player moves. Avoid hitting the walls or trail.

While playing, think about:

  • How does the game start?
  • What sounds do I hear?
  • When does the game end?
  • What animations happen?


Music Algorithm

This algorithm controls the background music. It plays a sound over and over again inside the forever loop.

Try changing the volume.

Try changing the sound: 

Test your code!


Backdrop and Animation Algorithm

This algorithm controls the animation and background for our game.

Try changing  and  

Make sure the costume blocks are named “_1” and “_2”

The animation speed can be changed too! Try changing:

Test your code!


Score and Movement Algorithm

This algorithm controls the score and movement. The orange blocks are variable blocks, which hold data or information. Our variable is named score and tracks the points for the game.

To start our game use to  start the game with a score of 0.

In the forever loop, we increase our score with

This code checks for certain buttons being pressed, and will turn our sprite to face in that direction. Try changing the keys:

The last block controls the speed of our sprite. Try changing:

Test your code!


Trail and Crash Algorithm

This algorithm sets up the trail and handles when the Player crashes into the trail or wall.

To change the players starting position and direction, try changing:

To change the colour and thickness of the trails, try changing:

This controls the Crash Algorithm. It is waiting until the “Green” sensor (at front Player) touches the “Brown” trail OR Player touches the edge. Then, it will stop all the other algorithms and say the score.

Try changing how the Player animates, by changing:

Test your code!


Remix & Extra Challenges

Here you can customize your game by changing the costumes and background, to changing how to play the game. 

Try some the following ideas to make your game even more AWESOME!

Sprint Boost

Add in a speed effect, when you hold the space bar down. And earn more points when sprinting!

Which algorithm will need to be changed to add in this extra movement and scoring?

Check out the code here

Two Player

Adding a second player sounds like a lot of work, but a lot of the code is already done in the first one! Right-click and select duplicate to copy a sprite along with its code. Adjust code as needed.

Do our two players start in the same spot? Do they have the same colour trails?

Remember to check for ALL colours of trails if you change them up!

Check out the code here

Outlast the Timer

Adding a timer can put more pressure on the player to outlast! Adding in a timer will give that urgency, but it is a lot more code we have to write!

What algorithms might have to change with the new way to end the game? Will our timer code be in an old algorithm, or will it have to be a new one?

Check out the code here

Extra Challenges:

  • Add levels
  • Change the level of difficulty as you advance
  • Add lives or health
  • Add levels
  • Add obstacles
  • Add power ups
  • Add a timer
  • Add in  for the numbers of some features

What other ideas can you come up with for your game?


Showcase your Work!

Share your game with family and friends.

What did we learn?

Share with us what it is we were able to learn today


Where to next?

We offer a number of courses that support what we know and build up new knowledge. You can follow the links below to some of our other course offerings coming up!