Firefighter Helicopter Game

Created June 14th, 2014. Built on the Raspberry Pi.

We had a lot of fun building this one. Devon wanted a helicopter game, and I was interested in creating the animation effect of the rotor blades. He then started talking about firefighters and such and I figured we could combine the two and make a firefighter helicopter! Brilliant!

I’ll be showing the final code here, but most of the fun in building these games is starting with something simple and then adding bug fixes and features as you go. When I just started with Scratch, seeing a command stack this long would have freaked me out:


As I’ve built more games, I’ve realized how helpful it is to have a variable like “flying” or “playing” to control the whole loop. I’ve also tried to remove “magic” values by storing them in variables so they can easily be adjusted later.

I put those variables in the stage code like so:


This game has the helicopter always moving and the arrow just changes the direction and the costume. The changing costumes also creates the animation effect of the rotors. Devon and I discussed various ideas and he liked having to refuel so we created a refueling station.


The ways you can lose the game is to run out of fuel or to crash into the ground. You gain points by putting out fires with your water. It’s fun to use the “touching X” sensor to figure out if you’re touching a specific color or sprite. The background design of the stage can be helpful for creating specific colors and features you want your characters to respond to.

Next we’ll look at the fire:


For this I created a list of x and y coordinates for the places I want the fire to show up. We then pick a random number and use that entry in the list to display the fire.

And the water:


We start with location of the helicopter, drop the pen and let it flow! If it hits the ground or hits the fire, we hide it.

That’s basically it! Want to try it out? Here’s the Scratch file: Helicopter Game

Things we could improve: I noticed there’s little incentive to fly higher. It’s easier to put out the fires when you’re low to the ground. I was thinking we could make the water run out and require the helicopter to go up into the clouds to collect more water. Might be a fun addition.

What do you think?


Thank you!

It’s day one of launching the Games by Devon website, and we’ve already received almost $20 in bitcoin donations! Amazing!

We put together this quick video to say thank you.


There’s a fun discussion going on over at the bitcoin subreddit as well if you want to join in.  Be warned, some of the commenters are a bit cynical. One said they would be calling child protective services on us. Heh.

I worked on six more blog posts this weekend covering the games we’ve made so far including Pong, Brick Breaker, Missile Attack, Helicopter Firefighter, Bone Digger, and Space Invaders. I thought it would be silly to release them all at once, so we’ll push up a new one every few days or so as we figure out what to build next. If you have any requests, send them our way!

Race Car Game with Bombs

Created June 8th, 2014. Built on the Raspberry Pi.

This is Devon’s favorite game so far and the very first one we created. The inspiration for this game started with this tutorial on wikihow How to Create a Racing Game in Scratch.

If you’re just getting started with building things in Scratch, you should definitely go through that tutorial first. Once we had the basic game in pace, we started adding improvements to it like checkpoints to prevent cheating (my wife figured out you can just drive on the grass to complete a lap quickly) and bombs which can be launched at other drivers.

Here are the sprites we ended up with:


The stage code sets up our variables and turns off the cars when someone wins.


For the car, we created two different costumes so it can blow up if hit with a bomb.


The code for the car is pretty complex and I probably added too many “When Clicked” handlers. The basic movement is controlled by the right and left arrows (or the “A” and “D” keys). We also move the car forward 2 steps if it is touching the white track and only one step otherwise. We have tests for if the checkpoints have been hit and controls for using a power boost (which moves the car ahead 40 spaces) or launching bombs. Figuring out the bombs was a bit tricky because I had to determine the final x and y position of the bomb using some trigonometry.


Since we know the angle we’re going to throw the bomb (the direction the car is facing) and we know the distance we want to throw the bomb (the “bomb throw distance” variable), to get the ratio of the X value we need the Sine function. Sine = Opposite divided by the Hypotenuse, S(angle) = O/H. To get the O value, we need multiply both sides by H for O = S(angle) * H. For every degree we add, the X value will be slightly less. For the Y value, we use Tangent which is the Opposite over the Hypotenuse.

It was fun trying to explain these concepts to my five year old. It would be accurate to say he got a little bored at this point.

When Corinne figured out how to cheat in order to beat her five-year-old son (sad, isn’t?), we had to add checkpoints. If you don’t go through each checkpoint, the lap counter won’t increase.


Later we added the bombs which broadcasts a message the cars listen for and change their costume to as needed.


Devon discovered a bug that you can still launch a bomb even if your car has blown up. As with all the bugs we find testing out the games, I wanted to fix it but he wouldn’t let me. He’s used this bug more than a few times now to blow me up even after he has blown up. 🙂

The code shown here is just for one car’s needs. You’ll have to duplicate them for the other car and change the variables and broadcast messages accordingly.

We had fun building out the car sprites also. The editor takes a little getting used to, but if you zoom in far enough and set the brush size small enough, you can do some fun detail work like this explosion costume.


Here’s a video of us playing the game with some of Devon’s neighborhood friends (prior to adding the bombs).


Here’s the full Scratch file for Race Game with Bombs so you can download it and play yourself.

A Five-Year Old Building Video Games

This year, for Devon’s 5th birthday, we bought him a Raspberry Pi. One of the first things we played with was Scratch, a visual programming language for kids and new programmers. We quickly started developing our very own games! I’ve been sharing the videos on Facebook and thought it would be fun to put them up on Devon’s very own website as a resource for other parents and young coders. I’m also thinking it could be his very first business as we will accept donations (in Bitcoin, of course) and may also develop games to sell.

We have some games we’ve already developed and we’ll be creating posts for each of them, including the scratch files so you can download them yourself. If you’d like to contribute to Devon’s first business, send bitcoin to 1NzWgRkq2jA2pagq29gSRtmTYwu4j5EFxK.

Devon’s really excited about getting his first bitcoin! Thank you!

Here’s an intro from Devon: