Making Games with Go(lang)
Using Raylib & Go to make games (hopefully)
So, I am a (self taught) web designer and after a few years I got pretty bored of HTML and CSS and decided to learn another language. After messing around with a few things I stumbled across Go and have been trying to learn it ever since. Originally, the idea was just to use it as an easy way of coding a remake of the classic DOS game Rogue in the terminal (ASCII art) as it was something I had always wanted to do. Go, if you weren’t aware, is not a language originally intended for games development, more for servers and web development and things like that (I think). However, it was (for me) a pretty easy language to learn when compared to others that I tried and it seems you can make games with just about any language these days.
From there, via the Awesome Go list, I discovered the Go bindings for Raylib, which basically allows you to make games with 2D and 3D graphics using Go. This has pretty much turned into my hobby over the past few years and so I will be sharing a few things I have learned along the way that should (hopefully) help you if you are interested in giving it a go (excuse the pun). Just note, that this is purely hobby stuff and Go is (almost) definitely not the right languge to start with if you are planning to get into game dev as a career. However, if you are just wanting to make some pretty graphics appear on screen that you can move around without having to spend years learning a more complex language then Go is a pretty easy to learn and use.
To start making games with Go and Raylib you will need:
- Go - https://go.dev/
- TDM-GCC - https://jmeubank.github.io/tdm-gcc/
- Git - https://git-scm.com/downloads
- Go Bindings for Raylib - https://github.com/gen2brain/raylib-go
- Visual Studio Code - https://code.visualstudio.com/
You can, of course, use other code editors however VS Code is my own personal preference
Don’t want to use Rayib?
As Go is not a language originally intended to make games with there are, unfortunately, not a lot of other options in terms of putting graphics on screen easily. The most popular alternative that is written in Go (not ported from C as Raylib is) would be Ebitengine and this is (at the time of writing) still in active development with many users.
So, if Raylib is not for you, then you might want to checkout the (short) list of other options at Awesome Go. Remember that some of the listed options have not been updated in years, not many people use them and there may not be a lot of support. One of the major problems you will face when trying to make a game using a non-mainstream language, engine or framework is that, with a small userbase, there are not a lot of foundation examples and code to learn from. So, if you are not confident in your skills, then rather don’t waste your time. If you are confident in your Go skills and don’t want to use Raylib then maybe check out some other more complex options below
Go is (really) not for game dev
The takeaway point from all of this is that I use Go for game development as a hobby and, whilst it is possible, I don’t think I will ever make a top-selling indie game using Go. I do it for fun, as a hobby, and it is unlikely that I will ever make money doing it. If you are serious about game development as a career or want to create an amazing indie game that will make you a fortune then Go is defintiely not the way to go (pun number two). Much better options are listed below and, if you are wanting to take game development more seriously then one of these would be a preferrable starting point.