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:

sprites

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

stage_code

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

car_costumes

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.

card_code

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.

checkkpoint_code

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

bomb_code

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.

editor

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: