Archive for the ‘Scratch’ category

App Inventor from Google is like Scratch

April 9th, 2011

The App Inventor, an in-browser emulator to write your own Android Apps, looks very similar to programming in Scratch:

Very intriguing…

You Make Me Sick!

April 4th, 2011

The winners of the STEM video game challenge have been announced.

The professional developer prize went to Filament Games for their web-based You Make Me Sick! It’s made in Flash and is a good example of a simple game done right.

Here are the student winners.

Working with variables in Scratch to make a score

November 17th, 2010

My demo game for today in Scratch involves checking to see if a button is pressed, changing a variable and a costume if it’s pressed, and then checking if the required score has been met.

The variable is boot to the head. *

When the green flag is clicked to start the game, we reset boot to the head and the costume to give the player a fresh start.

Next, we check to see if the spacebar has been pressed. If it has, we change boot to the head by one and do a mini-animation of a cat with a boot to the head. I put a wait command in there so the user’s eye can actually see the costume change.

We use an “if…” statement (found in the Control section) and use an operator (the green section) to see if boot to the head equals 10, our designated end of the game. If the player has 10 boot to the heads (boots to the head?), we reward them with a positive message of encouragement and then cruelly reset the score.

This is my demo, but I know that you’ll need variables to keep track of info in your games for the competition. Use the same techniques for your own variables.

Notice the big red X. The “if…” statement won’t work if it’s not connected to the rounded top of “When space key pressed”.

Your code should look like this for the demo:

*In no way does Mr. Griggs endorse giving walking cats a boot to the head.

Switching Backgrounds/Levels in Scratch

November 10th, 2010

For the STEM video game challenge, we’re using Scratch to make our games.

One of the things you usually need in a video game is the ability to change what the background looks like. First, you’ll need to create the backgrounds in Scratch:

I’ve created two backgrounds using the built-in paint editor. They’re very intricate backgrounds named “background1” and “background2”. You can name yours differently, just remember what you called them.

These scripts:

  1. Reset the background to background1 at the start.
  2. Broadcast either a Go to 1 or Go to 2, depending on what key is pressed.
  3. The script checks what’s broadcast and changes the level’s appearance.