Pac Man from Scratch

By Daniela Petruzalek

Elevator Pitch

Imagine that: a Pac Man clone written in Go that runs in the terminal, with emojis! This talk is not just about the game, but to also present a tutorial that can be used self-paced or as a workshop, to teach yourself and others the basics of the Go programming language.

Description

In this talk you will learn how to code Pac Man clone that runs on the terminal, with emojis! This talk is not just about the game, but also to present a tutorial that can be used self-paced or as a workshop, to teach yourself and others the basics of the Go programming language. If you are either interested in Go, or game programming, or both, this tutorial is a nice and fun way to learn new things.

While the game itself is very simple and the use of the terminal as a “screen” abstracts the need for using graphical libraries, we are still able to show some powerful features like the use of goroutines and channels.

The talk will be mostly code with little to no slides.

Some subjects covered by the talk: - Terminal modes (cooked, raw, cbreak) - ANSI escape sequences - Basics of game programming - Handling input - Handling unicode characters - Slices - Goroutines - Channels - Struct types - Strings - Pointers - Flags

All of that while evoking the classic gamer in all of us. :-)

Code for the talk: https://github.com/danicat/pacgo Video from the last time I’ve done it: https://www.youtube.com/watch?v=r-ur2Go4-vU

Notes

In regards to technical requirements there is none. I’m going to show the code in incremental steps just as it would be in the tutorial session, but with a faster pace, so we will be able to see the whole product in just about 25 minutes. The game has no audio so it’s not necessary to have a multimedia setup.