Chain Lightning > 2D

Simple chain lightning effect

Demonstrates a simple method to create an effect of chain lightning, when one rectangle (enemy) is impacted by a bullet rectangle then a chain of lines is drawn between the centers of all enemies on screen. WASD keys move player, left mouse button to shoot and up arrow key to change zoom. The Player Bullets example can be used a starting point for this example. View on Github

Player Bullets > 2D

Create player bullets on mouse click

Demonstrates how to create player bullets that will travel to a point determined by a mouse click on screen. This method works with a camera, using the screen to world position of the mouse click therefore the zoom can be changed. The player can move and the bullets will be destroyed when hitting the border rectangle. This can be used for both player bullets as well as enemy bullets, for enemy bullets the mouse click center point is substituted with the player center. WASD keys move player, left mouse button to shoot and up arrow key to change zoom. View on Github

Collision Rectangles > 2D

Rectangle vs Rectangle Collisions

Demonstrates how to check for collisions of moving rectangles against other moving rectangles as well as border rectangles. This method uses rl.CheckCollisionRecs and creates a duplicate rectangle which is then moved to the next position of the moving rectangle. If this next rectangle collides then the direction is changed. Checking for collisions with the next movement position, as opposed to the moving rectangle itself, prevents problems with rectangles intersecting. When using the moving rectangle itself, when the collision is reported as having happened, the rectangles are already intersecting which can cause problems. View on Github

List of Roguelites & Roguelikes Worth Playing

Nothing to play? These should keep you busy

So, my favourite genre of game is probably roguelite/roguelike and I have played quite a few. These are games that (generally) feature dungeon crawling (in some form), random (procedural) levels which are different every time you play and permadeath (no saving in the middle of a game so that you can restart if you die). If you are a already a fan of the genre, or maybe are looking for some lesser known titles to play then these are all recommended and should keep you busy for a few hours.

Howard Max Space & Time Detective Book Series

Did you ever read The Hitchhiker’s Guide to the Galaxy?

When I was growing up, Douglas Adams The Hitchhiker’s Guide to the Galaxy book series was one of my favourite reads, which I re-read many times. If you haven’t read it and are a fan of sci-fi and/or humor then definitely something to put on your reading list. Anyway, the books are very famous and quite good, though re-reading them as an adult I will admit some of the magic is lost, however they remain entertaining.

When I got older and had nothing to do one evening (or afternoon), I decided that I would write my own tribute to Douglas Adams famous book series, which I did. Though (probably) not as good, though not bad, and still requiring a huge amount of editing, I did eventually manage to complete this rather daunting task that I had set myself. I wrote and edited three books in the same sci-fi/humor style as Douglas Adams and self-published on Kindle Direct Publishing. It took a lot longer than expected (maybe 4-5 years in the evening in my spare time), I gave up once during the process and then restarted, managing to find all my deleted work again in an backup I had forgotten to delete.

Bitty Knight - A mini-roguelike game made with Go

Bitty Knight - My 1st 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

Moving Spike Block

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

Move to Point with Collisions

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

Move to Point

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

Fake Candlelight

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.