Bitty Knight - A mini-roguelike game made with Go

Source code is available on GitHub

I have been messing around for about 4-5 years in my spare time (I have a day job) learning Go to use for game development (more about that here) which is not a language generally used to make games. However, Go is easy to learn (in my opinion) and can be typed pretty quickly, meaning that you can get a lot done pretty quickly. Whilst 4-5 years is not quick, bear in mind this is only doing 1-2 hours a day in the evening after work and learning Go from scratch. For my use, Raylib was the best option for displaying the game graphics as it is easy to use and powerful enough for my requirements.

Anyway, after all this time messing around and feeling like I was not really getting anywhere, I have finally made my first game with Go and Raylib and it is freely available so you can download Bitty Knight on Steam if you want to try it out. Just note that it did not take 4-5 years to make Bitty Knight, learning Go and Raylib for game development took 4-5 years, coding Bitty Knight only took about 3 months. The game is short, only 6 levels and I made it free so anyone can play it, as it not a game that is good enough to charge money for. It was completed as more of project to prove to myself that I could make a (very average) game using Go without any real previous game development experience.

What have I learned? Well, that it is much, much more difficult to make a game than you think, unless you have previous coding experience or have lots of time to learn then you really need to make time everyday to sit down and get stuck in. Don’t give up, and try and try again would be phrases that I think would be important to bear in mind. I lost count of how many attempts I made at other game ideas prior to this one, most were overly ambitious, many were much better in concept, however as a solo developer (one guy), setting such massive tasks with no experience always proved too difficult. For this reason, eventually I decided to make something much simpler, although I have the skill to make a much better game, that requires much more time and dedication, though this is planned for the future. Anyway, if you want to play it, download for free Bitty Knight on Steam

Moving Spike Block > 2D

This demonstrates how to create a moving block with four spikes that move along with the block and cause damage when the moving spikes collide with the player rectangle. To complete this example you will need to download the tile sheet here. WASD keys move the player, SPACE key to create a new room, UP arrow key to change zoom and F1 key to turn on debug mode which will display rectangle outlines instead of images. View on Github

Move to Point with Collisions > 2D

This demonstrates how to move a player (or other object) to a point as determined by clicking on the screen. Left mouse click on the screen and the green rectangle will move to the point, recalculating X & Y directions as it moves therefore moving smoothly. If the player (green rectangle) collides with a blue block it will adjust movement accordingly, however, note that this does not find paths. This will purely stop either X or Y, or both, movement directions, dependent on the angle of movement. This example is based on the previous example Move to Point which does not take collisions into account which can be used as a starting point to complete this example. View on Github

Move to Point > 2D

This demonstrates how to move a player (or other object) to a point as determined by clicking on the screen. Left mouse click on the screen and the green circle will move to the point, recalcuting X & Y directions as it moves therefore moving smoothly. Note that this does not take into account collisions with other objects, if you would like to also check for collisions whilst moving then this example includes collision checking. View on Github

Artifical Candlelight > 2D

This demonstrates how to create the illusion of flickering candles in 2D using gradient filled circles. To complete this example you will need to download the candle image here. Note that this is not actually lighting, DOWN arrow key changes light color. View on Github

Before you start
I am a self taught Go programmer and do it as a hobby, the code below is my own interpretation of how to do something, probably not the only way or the best way. This is intended as a resource to learn some basic Raylib and Go game dev skills. If you want to use any of the code anywhere else, feel free to do so.

Artifical Motion Blur > 2D

This demonstrates how to create the illusion of motion blur using by drawing a second overlying image with offset and opacity.To complete this example you will need to download the sprite sheet here. Features change in blur fade (opacity) and blur distance. View on Github

Before you start
I am a self taught Go programmer and do it as a hobby, the code below is my own interpretation of how to do something, probably not the only way or the best way. This is intended as a resource to learn some basic Raylib and Go game dev skills. If you want to use any of the code anywhere else, feel free to do so.

Tile Loading & Grid Editor > 2D

This demonstrates how to extract images from a tile sheet and use in a grid based editor to create maps and level layouts. To complete this example you will need to download the tile sheet here. Features tile sheet loading, grid placement, color selection and clear grid. View on Github

Before you start
I am a self taught Go programmer and do it as a hobby, the code below is my own interpretation of how to do something, probably not the only way or the best way. This is intended as a resource to learn some basic Raylib and Go game dev skills. If you want to use any of the code anywhere else, feel free to do so.

Simple Exploding Blocks > 2D

This is an easy way to create an illusion of blocks exploding using a slices of structs that contain fade, color, rectangles and movement direction. Pressing SPACE key will create a slice of smaller blocks with random directions that fade away. Once the timer ends then it will reset and create more blocks. View on Github

Before you start
I am a self taught Go programmer and do it as a hobby, the code below is my own interpretation of how to do something, probably not the only way or the best way. This is intended as a resource to learn some basic Raylib and Go game dev skills. If you want to use any of the code anywhere else, feel free to do so.

Simple Animated Character > 2D

This demonstrates a simple animated sprite character as you would use in a 2D platformer game. To complete this example you will need to download the sprite sheet here. UP key to change zoom, DOWN key to change color, RIGHT key to increase speed and LEFT key to decrease speed. View on Github

Before you start
I am a self taught Go programmer and do it as a hobby, the code below is my own interpretation of how to do something, probably not the only way or the best way. This is intended as a resource to learn some basic Raylib and Go game dev skills. If you want to use any of the code anywhere else, feel free to do so.

Pixel Noise (Screen Artifacts) > 2D

Simulates pixel noise, or old movie-type screen artifacts, with color and size change. To complete this example you will need to download the Go gopher image here. UP arrow key to change pixel noise color, DOWN arrow key to change background color and RIGHT/LEFT arrow keys to increase/decrease pixel noise size . View on Github

Before you start
I am a self taught Go programmer and do it as a hobby, the code below is my own interpretation of how to do something, probably not the only way or the best way. This is intended as a resource to learn some basic Raylib and Go game dev skills. If you want to use any of the code anywhere else, feel free to do so.