Endless Runner
By Jay Marriner, 24/06/2022
A few days ago a friend asked if I would like to work on an endless runner with him; I said yes and got straight to work!

There were a few initial things to consider; first we had to keep the codebase small and as optimal as possible as it is going to be a mobile game, secondly I had to think about how to approach endless terrain generation for this type of game and finally we had to decide whether the world was going to move or if the player was going to move.

For the first issue we made it a general rule to refactor our code multiple times even if it was functional and working as intended. This means we are looking back over our "completed" scripts and ensuring it is done in an optimal manor.

For the second issue I decided that we would have a grid system with each position on the grid housing a "tile". Tiles would be a visual object and the system I crafted meant we could add variants very easily meaning it was simple to update and change in the future. This also meant generating the world was easy and we had a lot of control over how many tiles should spawn and when; this meant we could keep the game running at a smooth FPS.

For the third issue we decided it was best for the world to move, this made the game a lot less resource intensive as we didn't have to process movement logic for all the moving objects, we could simply make anything that moves toward the player, a child object of the moving object. It also meant anything moving forwards (the same direction as the player) could just have a running animation to simulate movement.

The project is 3 days in now and I'm really enjoying this task. It's a fairly small scope but also houses some complexity making it fun and educational to do. I also love making systems like terrain generation - it's always fun getting stuck into something like that!

That's all for now but watch the space... More will be coming soon...!