Running on and on...
- Rhys Sellars
- Jun 24, 2016
- 2 min read

The pieces of our 'Endless Runner' game keep falling into play each week. This time we covered off on implementing obstacles and introducing collectable items for the game. In order to spawn blocker objects randomly we had to create additional spawn points on our basic floor tile and child the block objects to the floor tile. We created an array of blockers and randomly picked one to spawn at one of spawn points. Further to this we created a death mechanic when the player crashes into one of the objects and reload the level. Through this we further expanded on the concepts of arrays, variables and the concept of casting.

We also implemented a coin pick up and a simple UI score which was really easy to do. To prevent constant spawning blocks and coins a switch was introduced to alternate at random between the two types. Again this was done by childing a coin spawn area on a floor tile, and spawning a limited number in a random location within this box. A sound effect was added for when the player collects a coin. Interesting enough, a bizarre glitch occurred where the sound was playing as soon as the game started, and the only solution to fix this was to drag the character's starting position forward. Seems like an unlikely issue yet fixed it nonetheless. Beyond this I went on myself to complete the entire 'skeleton' for the runner assignment, and I now have implemented corners, ramps and wall collisions.
To aid in ideas and what should be or could be included in the game, I played Temple Run 1 and 2. What is good about these games is how natural they feel to play. There are great pick up items such as magnets for coins, invincibility and dash abilities, as well as interesting level mechanics such as jumping obstacles etc. One thing I love is the variety of things that are occurring considering it is a relatively simple concept, as well as appropriate settings/audio etc. These games are easy to pick up and play without having to dedicate too much time and effort.
From this, I have already implemented some various floor tiles that are narrow pathways which greatly increase difficulty. This is not perfect at the moment and I have to tweak the frequency on when they can appear which should be similar to the way corners are determined. I also am planning on adding jump obstacles, as well as maybe special tiles that either speed up or slow down the player further. Also have to implement the progressive speed up of the players running multiplied by how long the game has been running for. Next is power ups, particle effects, more UI elements and polishing into a functioning game.

User supplied images. Screen shot taken from Temple Run for Android.
Comments