The Half-Finished Update

It’s been ages since I did an update, but lately I’ve had loads of work piled on me, so I haven’t had much chance to work on it, so there won’t be an update quite yet. However, I’ll use this as an opportunity to ask you guys what you want to see in the game, what improvements you can suggest, and what’s broken horribly (which I’m guessing is loads). I also have a couple new additions that will be in the next update to show you!

Slightly improved graphic-y stuff!

spikes-44I’ve made the signs at the beginning of each level a bit more detailed, and I think they look better with a darker theme. The old ones are on the top, the new ones on the bottom. As you can see, there’s now a sign for World 2 Level 2 which means…

…Super-Horrible Maze Level!

spikes-46I went a bit crazy with World 2 Level 2 so far, and it’s a bit mental. There’s dead ends everywhere and loads of traps (which I’ve yet to put in). Good luck with that one, it’s rather horrible.

Nicer GUI Things

spikes-47This new GUI is shinier and GUI-ier than the old one, and generally functions better than the old one, as it doesn’t use Unity’s native GUI classes, which are pretty slow. I’ll have this update out in the near future, although I’m not sure how long it’ll take as I’m not sure how long I’ll have to work on it.

Anyway, have a good Christmas (if I’m not done with the update by then), and I hope you have feedback, any would help!




Big Spiky Death Balls – Project Spikes 27/09 Update

I’ve finished the fourth level and improved the existing three slightly with features from this update. Firstly, I’ve added large spike balls. They’re rather deadly and tend to fall on your head.

spikes-15They were pretty fun to experiment with with positioning, along with Unity’s physic materials (especially the bouncy one) to make them hop around the stage like kangaroos on meth. I also added mini posters/ billboards that warn the player of dangers ahead, and one at the start of each level to tell you the level number.


If you wondered what the player looks like in my scene view, he’s a bright purple capsule. He’s a little bit feminine and proud of it.

I’ve used some existing objects to devise new traps for the player – you’ll have to find them for yourself though! Along with this comes a new health bar, which is much more colourful (and hence, better) than before; it’s a nicer way of displaying remaining lives and health. There’s a few new features such as a start screen and pause screen; the latter of the two is accessed through the escape key. The cursor stays frozen in the centre of the screen and hidden while the game in unpaused, meaning it won’t stray from the game window and interfere with other applications.

spikes-17Also, as some players pointed out, some moving platforms used to stutter when stood on, but this has been fixed now by updating their position in the FixedUpdate() function rather than Update(), as the former is ran before the latter. Turrets have also been improved, as their bullets get destroyed after coming into contact with any collider, not just the player, and they aim better.

-Added large spiky balls of death and physic materials
-Added a fourth level
-Added small warning posters
-New trap variants
-New health bar
-New start menu
-New pause menu -  press "esc"
-Fixed bullets only being destroyed after hitting player and turrets' aiming
-Fixed stuttering platforms

For next update, I will be finishing up World 1 and perhaps starting work on World 2. The fifth and final level in this world will be a bit bigger than the previous ones, and feature a puzzle in order to advance forward. So far, it looks promising.

If you want to try the game out, the link is the same as it always has been: play it here! And thanks for playing!

Random Code: Player Crouching

Unity includes prefabs for 1st- and 3rd-person characters, but they lack some basic movement features such as sprinting and crouching, which I find to be a little bit stupid, so I’ve written code to do this for me. It’s simple really – it starts by finding the character controller component attached to the player, then gets his (or her, equality fans) height, then when the player is holding the ‘c’ key, it scales down the character controller height so your player can squeeze into tiny gaps –  just attach a script with this code in it to your player and it should work. So, just for you, here is my code for crouching!

private var controller: CharacterController;
private var charHeight: float;

function Start()
    charController = GetComponent(CharacterController);
    charHeight = controller.height;

function Update()
    var height = charHeight;

        height = charHeight / 2;

    var lastHeight = controller.height;
    controller.height = Mathf.Lerp(controller.height, height, 5 * Time.deltaTime);
    transform.position.y += (charController.height - lastHeight) / 2;

How it works!

Firstly, the variable controller stores the character controller, then charHeight stores a float. In the start function, it finds the controller attached to the player and defines charHeight as the controller’s height as a reference point. Then in the update function, it takes the height at the start of each frame, then if the ‘c’ key is held down, it basically halves the height (smoothing it by using Mathf.Lerp, which takes the first parameter given to it and changes it to the second parameter over time, changing by the third parameter each frame, so basically in this case it takes the normal character height and changes it to half that by 5 units each second, through use of Time.deltaTime to ensure the change is framerate-independent. If that all made sense.) and moves the whole transform down in the y-direction by half the change in height, to match the change in the controller’s height. The net change is that, when the “c” key is held down, the player, along with the colliders and camera attached to him/her, crouches down. Feel free to use this code in your own projects, and if you have any improvements, you can post a comment here. Have fun crouching, and if none of my explanation made sense, just post a comment and I’ll get back to you 🙂

The Actual Actual Plan. Sorry For All The Vaporware!

Okay. I swear this time, I have a plan for real. I was dawdling about at home the other day and stumbled upon a video that explained why people sometimes have trouble completing projects (much like myself). One of the main reasons was over-ambition. I thought I’d be able to make a game full of unheard-of ideas, fantastic graphical displays and bug-free gameplay. However, I found myself at a dead end when small changes to one script started to completely ruin others, forcing me to pull back some changes and eventually, I decided to put my tower defense game on hold too, for a while. I’ve gone back to the drawing board, and found an idea that works: trying to make the most basic game I can, with a super-simple graphical scheme, focusing on the gameplay and trying to make the game more entertaining and much longer. So, now I’m working a new game where the objective is to get from the spawn point to a cube located somewhere in the level, and I will slowly start to add new gameplay elements and hazards as the player progresses. It has been codenamed “Project Spike” for now, as the first and only hazard so far is the spike.

spikes-1In fact, this is the first level. Just get to the goal, simple as that. The levels do increase in complexity, and so far I have included small platforms, some of which move, which means there are some minor jumping puzzles (don’t worry, they’ll get worse. Everyone loves jumping puzzles.), as well as spikes in the later levels. They are in no way challenging, but currently they teach the player simple game mechanics that will feature later on.

spikes-2This, in contrast, is level 7, where there are many spikes and more challenging jumps and moving panels. This method of level design is actually quite a lot of fun for me, as I can place more hazards and remove them at will to find the perfect balance of fun and challenge. I plan to have more worlds, which will each feature an important new mechanic, for example turrets (which I can take from my tower defense game) and some kind of pitfall or tripwire traps. The spikes take 10 health of the player each (so two spikes together will take 20 health), but the groups of 5 spikes are an insta-kill. The player has 100 health at the beginning (which I will show graphically at some point), and 5 lives. Falling off the level is also an insta-kill, and will respawn the player at the start of the level. Losing all of your lives will eventually cause a Game Over screen to appear.

spikes-3My favourite graphical part of the game so far is actually the advance cube; I simply made a .png of a swirly cube thing (it was originally going to be simply an outline, but my hand slipped and I messed it up, but it looked cool, and this was the result of a couple minutes’ work), made a material with the transparent/cutout/diffuse shader, and this fancy-looking cube is the result (well, it’s one cube in another actually).


In every level you’ll also be able to find a ‘Secret’, a collectible item that should be hard to find. It’s a re-coloured advance cube, and it looks rather attractive. It’s currently not actually able to be picked up, but the locations of them won’t change, so if you find some, great going! I’ve not yet put them in every level (at the time of writing, there are only actually two), but they will be in every level at some point.

Most importantly, I actually worked out how to make a Unity Web Player build of the game and host it through my Dropbox, so you can try it out right now hereCurrently, there really is not much to see, but I will be adding many more levels over the coming weeks, and perhaps I will actually get this project done!

My Actual Plan. More Spontaneous Changes!

As you may have read almost a month ago now (sorry, I have been extremely busy catching up with AS Further Maths and a bit of Chemistry and Physics A2), I’ve been changing my plans a bit. Now to clarify exactly what I’ve decided!

I am about to enter Year 13 (the equivalent of the second year of college), and I am going to study Maths, Further Maths, Physics and Chemistry; one more A-level than most people. This is because I found out, towards the end of Year 12, that Geography is useless if you want to study Computer Science at university. Yeah, I guess that’s obvious, but 16-year-old me didn’t know what he was going to do later on. So I switched that with FM, but I decided to do the entire A-level so now I have to catch up on the AS. I hope to get into Cambridge, but the entry requirements are high (A*AA I believe) and I must take FM as one of those. I hope by doing one more A-level than the average person it will help me stand out as a strong candidate, as Computer Science is a subject I really want to study in depth and it will help greatly in what I want to do when I’m older. Anyway, enough about me, what about my games?

I decided to put my 3D Platform game on hold for a while, as it was far too ambitious for my skill level. Now, I am following Brackeys’ tutorial on Unity survival game development, which is extremely helpful with scripting and generally explaining everything you need to know. But in addition to this tutorial series, I have started the development of a small tower defense game, which so far has been very easy to plan and develop.

tower-defense-2This is a screenshot of early development, where I played around with stuff to see what worked and what didn’t. Each small metal tile allows the player to place a turret on it, which will the automatically fire at any nearby enemies. Currently, I’m trying to shake out the bugs with this mechanic, but it’s working well so far. The cube in the top-right corner will be the target the enemies try to reach (except it will have a proper model later, along with many other things in the game), and if it gets destroyed, the player loses.

tower-defense-1In this game, I’m trying to improve my level design skills to make the game as enjoyable as it can be. The first level will have a sci-fi theme, with futuristic textures and enemies. I’m slowly making progress with the level in general.

tower-defense-3This has a similar layout to the pictures shown above, but with small tweaks to the scenery. I hope to make the scene as detailed as I can. I have worked on the enemy AI (he is the red cuboid in the top picture), which is currently very simple, but he follows the path I’ve laid out correctly and attacks the box at the end, although nothing happens to it yet. The turret placement is working, and later on I will have a series of buttons along the bottom allowing the player to select different turrets, but I have to model some first. Different turrets will shoot different bullets (or lasers, or bombs), and some will be stronger than others. I could write more, but when I have a more complete version finished, I’ll make a complete list. This is the summary for now:


  • Turret placement points, allowing the player to place turrets in the level. Cost 100 points each currently.
  • Points system, where the player is rewarded with points for killing enemies. Points are used as currency to buy turrets.
  • Enemy spawner, which will send waves of enemies through the level.
  • Target for the enemies at the end of their path – if this gets destroyed, the player loses the level.
  • One level to begin with, with a sci-fi theme.


  • More enemies and turret varieties – different enemies will have varying health and movement speed, and different turrets will have different bullets and attack strength.
  • Better points system, with different enemies and turrets giving/requiring different amounts of points.
  • More scenery for the sci-fi level, and eventually more levels.
  • Better wave system, in which higher numbered waves will feature stronger/more enemies.


  • Turrets aim straight at the enemy, so when they fire bullets, they often don’t hit the enemy, but the floor just behind the enemy. (potential fixes: turn down the gravity for the bullets or increase their speed? Try to aim in front of the enemy?)