Welcome to my blog! Below are the most recent posts. From the Menu you will see Posts (excluding series) and Series which go through detail in building part of a game or a whole game.
Short Note
Before we jump in
For our 2D apps I may want to use sprites to start with, so I wrote a little project for sprite sheet atlases and an app that uses it as an example. We will use this sprite sheet description atlas to give the app info about our sprite sheet without needing to hard code all the positions of each sprite.
The code is MIT so you can use it as you please as long as you read the licence and agree to it. It is placed there for your 'learning' and you may choose to make changes to it as you please though forking it and submitting improvements will be welcome should you choose. You may need to send a message to me to get it working correctly for you to make submissions.
The sprite sheet image uses alpha-color which means the image file doesn’t use an aplha channel but simply a color like purple to be the alpha channel. So I wrote ~ after consulting AI ~ a few extra functions in the go-rommy example that copy the image and repace all the colored pixels to alpha. I could have used a mask ~ I’m sure its pretty much the same.
By Richard Porteous
read moreGO & RAYLIB ~ Get Setup
POST UPDATED : 2025-11-21
Intro
This tutorial we will setup your Raylib-go dev environment and create a project which will produce a blank window. In a Windows 11 environment. The setup on Linux and Mac are well described on the raylib site. Windows requires extra effort to set up a C compiler but has a very simple method of using the raylib-dll. We will use this method to get you started as quickly as possible.
Requirements
- You need Go installed ~ the newest version is often a good idea, then stick with that untill you are comfortable. You can get it from GO.DEV downloads
- Git from Git-scm.com/downloads
- A text editor or an IDE. VSCode, Goland, Notepad
What experience has shown me
- Git is essential. Yes for version control, BUT mostly helps you NOT to loose all your code.
- Writing Tests is more important than you think and does save time. Weirdly and automatically you write manageable code.
- Learning a new computer language is not difficult but not simple either. (similarities trip you up - often)
By Richard Porteous
read moreBasic Movement
Basic Kinematic Animation - Movement first
2D frame based animation (2D kinematic animation) is easier to explain so we will start there.
2D kinematic animation is controlling the movement of an object without physics involved. We simply move in a direction at set intervals. To keep the speed of the motion same on different size screens we need to take time into account. We will make use of the number Frames per second or more accurately the time difference between each frame (delta time) included in our distance calculation. Don’t worry its quite simple. We ‘animate’ our character by swapping the image with another image every few frames or fraction of a second.
Get an image to move
Lets start with an image that won’t change. I’m going to use Kenney’s website for the 2d art to download the car racing bundle. It’s free to use with option to support his efforts. The site and link above is https://kenney.nl/assets/racing-pack