Adventures in Unity – 1.4a Tighten & Tidy



This probably isn’t the most professional approach to development.

But what I tend to do, every so often, is to stop expanding the game (adding new functionality & features) and spend a little time refining what I have – Both in how the game works & looks, and in how the code is structured.

Note: I only really do this on games – such as this one – where I’ve started with no specific goal, endpoint or design in place – Just a general idea of what I’m trying to put together.

By refining I mean;

  1. Making changes which don’t require much (or any) code amendment, but do take a little time to refine (e.g. trying out different fonts for the GSM font or changing game scroll speed).
  2. Making small refinements to existing code which has a large impact overall (e.g. Making the players score based on a timer instead of a frame count).
  3. Tidying the code a little – removing anything that’s no longer required, updating whatever remains.


This allows me to keep control of the code as functionality expands and ideas/implementations change and are refined.

It also helps me try out new ideas – which I can test out and tighten as development continues – even remove altogether if I decide I’m going down the wrong path.



Reorganised GSM UI – Used tank font & expanded GSM text

Added materials (textures) to platforms and player (gem & rock) – Trying out new looks.
Removed materials – None of the new looks seemed to work.

Updated collision – Platforms are just Unity cubes; Checking that the player has hit the top face allows;
Player can now only jump when on the ground – removing the Flappy Bird style controls.
Change platform colour on collision – Trying keep things visually interesting without using materials/textures.
Added platform collision count – Whenever the player lands on a platform (hits the top face of the platform – a point is added – Currently used to increase scroll speed.

Changed score to display a timer & the platform collision count – Not the final score set-up; trying to figure out what info I need to see.

Changed camera position & rotation – Ensures the players block position is always clear.

Locked players Z position – To stop the player cube from bouncing off into the distance.
Tightened off screen check – It took too long, after the player moved out of play for the game over screen to show.

Updated controls – Space or mouse click are used to control the player and start new games.
Updated controls – The longer the space bar/mouse button is held down, the higher the player jumps. Using a modified version of the jump code from Magic Thighs & Slightly Phil.

Ensured platforms vary in height – Platforms are now guaranteed to be different heights (but not so different that the player cant jump between them).
Game increases in speed over time – Increasing game difficulty the better it’s played.



This isn’t supposed to represent the code in it’s final form –  But it helps me keep a handle on the state of all aspects of the project.

There are still plenty of issues with the code as is (for example there are lots of times when the game starts the player falls directly between platforms), and lots of features that I need to add – Hopefully after tidying and tightening the code, I’m in a better position moving forward.


Play the game (WebGL)

Grab a copy of the project here




Next post: 1.4b Tighten & Tidy

Last post: 1.3 Initial GSM

Contents page.



2 Replies to “Adventures in Unity – 1.4a Tighten & Tidy”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: