Super easy labyrinth game with Scratch

  1. First, you’ll need a maze. You can use your own or download this:

To make things simple, make sure that whichever maze you use, it has no openings. This is how we avoid player form coming out of the maze and just bypass it from outside.

2. Download your maze of choice as a backdrop:

3. Delete the cat

4. Pick new sprite (character)

Double click the one you want. In this example, I choose Ladybug1.

5. Edit sprite’s costume

6. Draw a box around your sprite with mouse. (Click and drag the box over to opposite corner.)

Now, click on one corner and drag the sprite smaller. Good size with this maze is somewhere around 20×20, I use in this example 18×19. You can check the size here:

It’s not a problem if it’s not perfect square, for example 17×19. Just make sure that both numbers are small enough for your sprite to walk in the maze without touching the walls.

Now the code:

Make sure that your starting coordinates are right. 

To get the touching color right, first click the box that has the color in it, then click at black part of the labyrinth. 

This is now very basic, we could add some goal to the end:

There are several ways you can make this game better if you want to. Here are some ideas:

  • Time to complete the labyrinth
  • Some collectables
  • Player moving all the time, only the speed is altered when player uses keyboard
  • More levels

2 easy and 2 professional ways to teach coding

I’ve been teaching coding (along mathematics) for kids aged 9-16 for several years. I’ve proceeded in this order:

  • code.org
  • Scratch
  • Python
  • Unity

First two are quite easily doable for teacher/parent with no programming experience. About the last two, I personally think that Unity is more appealing for today’s youngsters, but as an example of text-based coding Python is ok.

Code.org

Contains several lesson for different age groups. Still, consider your pupils experience before starting. If they have no experience at all, they could shortly go through materials for younger kids before proceeding to their own age group and vice versa. If you have no experience yourself, it’s highly advisable that you do the lessons yourself beforehand. Make sure that you find the ways to use suggested amount of code lines, as there are sometimes many ways to solve a task, usually the shorter the better. Link: code.org

Scratch

Compared to code.org, Scratch is more open environment. It needs Flash player. You can actually do your own games if you’re registered user, for others to play. Coding happens by dragging blocks from left to right. Here is a picture of one of the most basic programs in Scratch:

Pay attention to block colors; color of the block will tell you from which block group it’s from.

  1. Every program has to start somewhere. This will start when clicking the green flag. This is a common way to start Scratch program. (Other common option is starting with a key from keyboard.)
  2. Forever-loop is important. Otherwise program will end before user gets to press anything.
  3. There is a coordinate system. Using this system makes it easier to move the way you intended. Other option is to use steps, but then you have to be cautious with direction. Steps always uses direction to determine where to go.

And there you go! You can modify this basic program in numerous ways.

Python

Sometimes you need an example of text-based programming language and Python is one of these. It’s relatively simple to learn. It can be used many ways:

  • Install Python to your computer. Write code to .py text-file and compile it. This is the hardest way, but best if you write longer programs. If you’re using Windows, change path-environment variable from settings according to where your python.exe is located.
  • Install Python to your computer and use ide that comes with installation. Ide means that you can write code and see the results right away.
  • If you don’t want to install it (yet), you can use online ide, such as ideone.com There you can also use other programming languages. Downside is that if you are not careful, you may lose some work.

Here are some very basic examples (and by the way, printing doesn’t mean it prints on paper, only on screen):

Printing numbers form 0 to 9:

for i in range(10):
	print i;

Printing multiplication table of 5:

for i in range (10):
	print ((i+1)*5);

Printing first Fibonacci numbers:

numberA=1;
numberB=1;
temporary=0;
while(numberA<1000):
	print numberA;
	temporary=numberA+numberB;
	numberA=numberB;
	numberB=temporary;
Unity

Unity unites text-based coding to graphical interface, making it fast and relatively easy to develop games. Several commercial games have been created with unity, see list of examples here. Unity is not the only one of it’s kind, but it is definitely one of the most significant game engines.

Good news is that Unity is free for private use and even when you are earning a little with your game you’ve developed. I’m not eager to put any specific details here, please check from Unity’s website if you have any questions with licences.

I have a plan to make some Unity related content for educators but that idea is still in its infancy. Before that, you can check their own learning page: https://unity3d.com/learn