This game was designed by a developer who started to learn the Go Programming Language, he needed a project with some challenges and obstacles to be able to learn through experience.
After reading this article you will get some insights into the development process, tools and the source code of the game.
The concept of the game is to inmerse yourself into the Terminal world, where you must chase bad guys and Shoot to Kill them all.
Keep in mind this project was developed by someone with no previous experience in the language or multiplayer game design and completed in only 3 months.
One of the challenges faced by the developer was the definition of the **Collision Function **which is one of the most complex:
The collision function is one of the longest in the codebase, and is probably the messiest. Maybe with more entity types you could abstract what happens when two entities collide, like the laser could be “lethal” and the player could be “killable”, but it didn’t feel worth it when writing this.
Maps are just two dimensional set of runes defining elements like spawn points or location of obstacles and walls. You could define your own maps like this:
The Frontend of the game, one of the elements giving the unique look to the game and probably the secret of it’s suceess is based on a project which lets you quickly make terminal user interfaces in Go.
The design of the frontend isn’t remarkable or complex — in fact that part of the codebase is the least “architected” compared to other packages. For displaying game state, the viewport is redrawn at around 60 frames per second, and literally loops through the game’s entities and map to output ascii characters at the appropriate position.
The project is called tview and it’s worth taking a look at.
If all of this sounds exciting and you are looking to learn how to program in Go, then take a look at:
Book: Programming in golang
Please share this game with your friends, visit the repo and leave some feadback. The developer has nice articles on his blog about the game itself and the creation process so people can learn from his codes.
You can check out the code for this project at https://github.com/mortenson/grpc-game-example, and can download binaries in the releases page.
If you are a retro gamer you might like:
My other DEV Posts: