Better Programming

Advice for programmers.

Follow publication

Member-only story

How To Code a Simple Game In Golang And Fyne

Jes Fink-Jensen
Better Programming
Published in
7 min readMay 25, 2022

Some time ago, I followed some of the interesting tutorials by Frank’s Laboratory on how to code games in JavaScript. I have decided to code one of his simple games in Golang using the Fyne GUI toolkit for this article instead of JavaScript.

The structure of the code that I present to you here will also be somewhat different from the original by Frank’s Laboratory, given that Golang works differently from JavaScript.

As in his video tutorial, we won’t be building a complete game, though. You’ll be able to move a character around on a background image using the arrow keys on your keyboard. Nevertheless, this could be the start of an actual game.

The Game Assets

Below, you can see the two-game elements used in this project.

We’ll use a Starwars background and a sprite sheet featuring Chewbacca, aka. “Chewie.” The original links to these assets can be found on the YouTube page of the tutorial by Frank’s Laboratory.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Write a response