Wednesday, September 27, 2017

Review: Code Your Own Games!

Bowen's been playing a number of computer games during the summer, and would frequently ask questions like: "How come this boss monster could change his shape?" That sort of thinking led me to believe that he was ready for the next step: learning to program a computer so he could make his own games.

I had originally thought of building a "game construction kit" out of something like Unity, but a few attempts at the tutorial made me realize that this was way too complex. I'd heard about Scratch before, but the online tutorials left me cold. It wasn't that I couldn't figure out the programming language, it was that I was bereft of ideas as to what to do with it that would make interesting projects for Bowen that wouldn't bore him to death. (For whatever reason, it takes a heck of a lot more than "Hello World" to interest a kid used to modern computer graphics!)

I bought Code Your Own Games! with relatively little expectation that it would actually be good. It's relatively cheap, and was spiral bound so it would lay flat, and with Amazon purchases I figured returns are easy if it's a piece of junk. When the book arrived, Bowen picked it up, and with the alacrity of a child flipped past the "introduction to scratch" page and jumped straight to the first project.

My heart sank when I saw that the book was simply of the format: "Step 1: draw this sprite. Step 2: drag this code to the script tab". Then I noticed that each piece of code was explained with text (not that Bowen would bother reading those!). The projects immediately always did something fun, and half of the project would involve drawing rather than coding (which is about right when it comes to modern game implementation). What was interesting to me was that Bowen didn't learn so much from the book's coding, but from finding "bugs" in the resultant game behavior and modifying the project so the game behaved the way he wanted it to!

For instance, in project 8 (Catch the Donut), he noticed that even when the game was over, you could keep clicking on the donut and score points. So this became an opportunity for him to learn how to implement boolean flags in a language that didn't have them, and how to use those flags. In project 4 (Drive me Crazy), he didn't like that the car would move when the throttle wasn't pressed down, so he fixed the code so that the throttle would have to be down for the sprite to keep moving.

The language is never formally taught. It's used and the child's expected to pick it up (which is great, that's how programming languages should be taught). Scratch is an object-oriented language with event-driven features, and the unstructured nature of the "drag and drop" code tab gets kids used to the idea that multiple things could be happening at the same time for a sprite. The environment is kind of crude, with copy/paste, etc not really implemented well, but it works. Everything happens online, but you have to manually do your own saves and backups, and more than once Bowen lost some work because he forgot to manually save.

Overall, for a 5 year old, this is not a book you can just give to him and expect him to solve major problems. You'll have to help and coach him (including teaching him to make backups), and lead him through some of the problems. But for $7.12, this is a great introduction to programming, doesn't require a powerful computer, and has shown Bowen that the only thing more addictive than a video game is writing one. Highly recommended.

Post a Comment