Following on from my previous interest in games like Terraria, I decided to try my hand at developing my own version. I was particularly interested in the lighting of the world as I had played around with dynamic lighting before but had never reached a satisfying point where I could say I was done with it.
The generation of the world used the same method I used to create the planet generator, just this time it was not mapped onto a circle. By using a two layer map I could have both foreground and background tiles, allowing for backdrops to be created for the various buildings and caves that I wanted to implement.
Basic physics were added that allowed the player to move and jump around the world and the ability to place both types of tiles on the map as the game was running. Adding saving and loading to the map allowed me to implement a simple compression technique I had recently learned called run-length encoding.
I used this game as a chance to learn how to create and implement sprites and textures within my games, the use of connecting textures to show the borders of the walls and floor being a favourite of mine today. Creating a player sprite was still beyond me at this point though so the player was left as a transparent box.
The lighting used a form of flood fill to determine how ‘deep’ each tile was from a light source but I had trouble updating tiles when new lights were added or tiles were removed. I had to take out falling sand blocks due to these issues with lighting.
While developing this game I had started creating a general use library to use in future games. It included simple QoL functions as well as managers for keyboard input and window management. This library was present in every game I created using Dark Basic from now onward.
Comments are closed.