Teaching a kid to code with Pygame Zero

Teaching a kid to code with Pygame Zero

How can you excite a kid about computers? One way is through video games! In this article, I'll focus on my experience teaching my six year old son some programming by using Pygame Zero.

How can you excite a kid about coding and computers? As a software developer and father of two children, I think about this question often. A person with software skills can have big advantages in our modern world, so I’d like to equip my kids for their future.

In my home, we play video games together. My children (aged six and four) watch me play through many classics like Super Mario World and The Legend of Zelda: A Link to the Past. They like spending that time with daddy and are really engaged with the video game. When I considered how my six year old son might enjoy coding, using video games as the channel into computing was a very natural idea.

I’ve only recently explored game development myself so making a game with my son seemed like a great idea. When I asked him if he wanted to make a game, of course he said “YES!”

To Scratch or Not to Scratch

Once I confirmed his interest, it was time to figure out what to make. In the past, we tried out ScratchJr. ScratchJr uses a graphical interface and UI blocks to compose a set of actions. The tools that come with ScratchJr include looping, counting, and many of the other core things that belong in software development. My experience watching my son showed that ScratchJr was too far removed from programming.

ScratchJR user interfaceScratchJR user interface

At first, my son would drag little characters onto the screen and make them jump up and down or move from one side to the other. Later, his play transformed into using the application as a glorified paint program. He would record clips of his voice, change the colors of the characters, and mess around with the scene in countless other ways. I love art and have absolutely no issue with him pursuing artistic interests, but ScratchJr wasn’t teaching programming skills. I don’t know if the actions were too limited, or if he didn’t see the tool as a way to make interactive things.

When I considered our game project, the ScratchJr experience made me rule out Scratch, the more advanced version of building block programming. I also listened to an excellent episode of Talk Python To Me that helped re-enforce my belief that Scratch was not the path to take. In the episode, Michael interviewed Nicolas Tollervey about Teaching Python with the BBC micro:bit.

Nicholas made an awesome point that stuck with me. As a trained musician, he noted that musical instruction teaches kids on real instruments (albeit smaller to fit the size of children). Kids develop musical skills with real instruments, and these skills are directly transferible when a kid gets a larger version of the instrument as they grow. We know this system works because it’s how kids have learned instruments for hundreds of years. His point was this: if musical instruction demonstrates how to teach a kid a complex skill like playing an instrument, why shouldn’t we bring this strategy to teaching programming?

At that moment, I became convinced that the best service I could offer my son was to teach him with a programming language with all the features he would need. Naturally, as a long time Pythonista and user group organizer, Python was my obvious choice.

A Kid Running Python

I still had a lot of aspects of this project to figure out. What is the right user interface for a kid who doesn’t know how to touch type yet? Readers of my content may know that I’m a big Vim fan, but I certainly wouldn’t subject my son to that (yet! 😉 ).

Thankfully, there was more gold in that Talk Python To Me episode. Nicholas is also largely responsible for the Mu editor.

Mu user interface

visual studio code visual studio code

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

COMO USAR e trabalhar com Code Review no Visual Studio Code

💲 Live CollabPlay: https://youtu.be/B6LCFSPdsE0 💲 Hospedagem com Desconto Exclusivo: https://tekers.tech/4e587 Não é todo programador que gosta de compartilh...

User Snippets (Code Shortcuts) in Visual Studio Code

#vscode Hello, my friends and fellow developers, this video is all about User Snippets. That means the Snippets (Code Shortcuts) that you can make for yourse...

Python в Visual Studio Code

We are pleased to announce that the July release of the Python extension is now available for Visual Studio Code. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. If you already have the Python extension installed, you can also get the latest update by restarting Visual Studio Code. You can read more about Python support in Visual Studio Code in the documentation .

C++ Development with Visual Studio Code

If you’re looking for a fast and lightweight open-source code editor, Visual Studio Code has you covered. Come for a deep dive into the features of Visual Studio Code which provide a rich, productive environment for C++ development.

The History of Visual Studio Code

We speak to the creator of Visual Studio Code about the early challenges to now becoming the most popular development environment in the world.