Monthly Archives: November 2015

GAM 111.3 Reflective Development Logbook Blog 9 (Week 10)

Week 10.

So in this week’s class we started with a blank game project and learnt some different camera moving techniques and object moving via mouse clicking.

Camera {

One of which was if the mouse pointer was at past the screen bound (see Screen.Width & Screen.Height) it would move the camera either up, down, left or right depending which screen bound the mouse was past. It was done using Unity’s transform.translate(Vector3.Right * speed * Time.deltaTime) to move right ( -speed for left). And transform.translate (transform.forward * speed * Time.deltaTime) to move up (-speed for down).

We also learnt was how to make the camera “Zoom” in and out, which is really simple but effective. This is done by simply checking if the mouse scroll wheel is greater than 0 move the camera down. If it is less than 0 move the camera up.

Another interesting camera technique that we implemented is that while the camera is ray casting , if the distance between the camera and the object that the ray cast is hitting is not the same as the height variable for the camera && has a tag “ground” the camera moves itself upwards to make the distance between the camera the same as the set variable. So it’s like a terrain scrolling camera. It’s a sudden movement, So if the camera hits a big cube the camera will jump to the correct distance. I’m sure that i could make it a smooth transition by lerping.

Camera Movement 1


Camera Movement 2


Object movement by mouse clicking  {

And being able to select a game object in the scene by left clicking (in this case our little capsule) and move it to a destination by right clicking. Selecting the capsule was done by Raycasting  and if the object it hits tag is “Player” it would store that the object it has hit as a game object. Then while the Player is selected if we right clicked it the capsule would navigate its way via a NavMeshAgent and navigate around obstacles using Navmesh obstacle and having the carve option selected.

Moving Objects Via Mouse controls

We also learnt how to instantiate a prefab game object (in this case a building) at the mouse cursor’s position after pressing the ‘f’ key, and then on left click would place the building at the location.





So by the end of the week my tower defense assignment looked like this:

GAM111.2 Progress Screenshot 1.png

Where The Enemies run from

This is my Gold Gatherer

This is Bruce

Picture 1: Over view of the landscape and user interface along with the resource tracker.

Picture 2: Where the enemies spawn. They run towards the middle bottom section where when / if they enter the trigger zone, they die and a life gets deducted.

Picture 3: This is my Gold Collector. When an enemy dies from being shot to death by a Tower, they instantiate gold, and this little fella goes and collects it.

Picture 4: This is Bruce. My Builder, he builds things.

  • The towers also do damage.
  • The tower projectile tracks the closest enemy target’s location.
  • I have also added the camera movement like we did in class automatically moves up, down, left and right if the mouse cursor goes to the screen bounds. But I did not make the camera automatically adjusting its height if the ray cast hits something. The camera will just stay at one height unless the player scrolls.



One of each enemy starts at the top (in either three lanes) and navigates their way to the end zone via NavMeshAgent. When they reach the end they die and deduct a life from the total amount of lives remaining. If towers kill them before they reach the zone, they instantiate gold ready for collecting by the Gold Collector.

The Gold Collector has a little hidey hole that he starts in, and while the Game Controller is keeping track of all the gold in the game, If there is no gold on the play field, he sits patiently. If there is gold to be collected, he navigates his way by NavMesh to the gold that is closest to his location. If the is no gold on the play field and he is not in his hidey hole, he returns.

I have added a builder and used the exact same way we have in class to make him navigate the landscape by left clicking to select him, then right clicking to move him. When he is clicked on, the a building menu that I made pops up :

Building Menu

Then when that button is clicked, this menu pops up:

Tower Menu

(The images of the towers were actually of the game object’s themselves inside of a little photo booth I made to take images of them and use the images for the buttons)

The ‘Towers’ button takes the player to the selection of towers available to place. Clicking ‘Back’ in the tower selection menu closes that interface and opens the tower menu again. When close is clicked, the tower menu closes and the builder is no longer selected.

When any of these buttons are clicked, it instantiates a prefab of that tower to the mouse position just like we did in class. Each button runs off the same script but that script holds one method for each of the towers to choose from. The method that decides what tower to be built goes like this: The UIController Hold’s all the buttons, the Game Controller Stores all the prefabs for the towers in an array and there is a method that takes one argument (in this case it is an int) that instantiates the tower. So when the button is pressed (depending on which one it is) the method calls the build a tower method from the game controller that takes a single int argument, and gives it a number according to where it is in the array. Then the tower has been instantiated at the mouse position and moves with the cursor and can be placed wherever the player left clicks. The towers are only supposed to be placed on the bottom level to make the enemies maze through but I haven’t implemented a way for the towers to only be placed where I want them to be yet.


Resource Tracker

I’ve also created a tracker  that shows how much gold the player has, how many enemies the player has defeated, how many lives are left, and what wave the game is up to. (The wave counter is just a number at the moment, it will be used soon)

Last week’s plans {

I can say with confidence that this game has progressed so much in the last week. Even though I have only sculpted the landscape and not set checkpoints yet, I feel that what i did instead still needed to be done.


Problems encountered {



Plans for next week {

Set up checkpoints for the enemy to run through.

Set up a way for towers to be placed only in certain areas.

Set up waves for the enemies to be spawned in.

Set up a gold cost for each tower.

Add some more detail to the landscape.

Set bounds for the camera to stop if the camera moves to certain X or Z distances.

Have the game up to play testing so I can start tweaking damage/health/speed values.


On that note, I’ll leave you with this weeks song:


As always, it’s a pleasure.


Until next time –





Information source:

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 24 November 2015, from


Image source:

Lyness, N. (2015). Strategy Framework Camera Screenshot(1). Retrieved from

Lyness, N. (2015). Strategy Framework Camera Screenshot(2). Retrieved from

Lyness, N. (2015). Moving Players Via NavMesh Screenshot(1). Retrieved from

Lyness, N. (2015). Landscape Screenshot With GameScene UI. Retrieved from

Lyness, N. (2015). Enemy Start Location Screenshot. Retrieved from

Lyness, N. (2015). Gold Collector Screenshot. Retrieved from

Lyness, N. (2015). Bruce the Builder Screenshot. Retrieved from

Lyness, N. (2015). Builder UI Screenshot. Retrieved from

Lyness, N. (2015). Tower UI Screenshot. Retrieved from

Lyness, N. (2015). Resource Tracker UI Screenshot. Retrieved from


Video source:

In Hearts Wake,. (2015). In Hearts Wake – Breakaway. Retrieved from

Leave a comment

Posted by on November 24, 2015 in Uncategorized


GAM 111.3 Reflective Development Logbook Blog 8 (Week 9)

Fiery number 9

Week nine!

So for this lesson we had expanded a bit more on the side scroller that we started last week. The spider now patrols (walks back and forwards) between two points, which a located at the end of the platform that it stands on. We have also made the spider angry!

Angry Spider

No, but seriously, we have.

An “agro zone” which is just an area or space, located somewhere close to an object. In this case, the agro zone is just a big box collider that spans the length of the platform that the spider patrols back and forth on.

Agro zone screenshot

When the player, (Skeleton) enters this agro zone, the agro zone talks to the spider and saysWaving Bear

“Hey, theres someone in your zone, go eat them” (it doesnt actually talk out loud) then, the  spider turns to look at the skeleton, thinks “FRESH MEAT” , changes it’s walking speed and charges towards the skeleton. Once the spider is close enough to the skeleton, the spider starts to attack! (and also plays an attack animation)

Spider Attack


As for my Tower Defense assignment, I have created a total of 11 enemies (By create I mean import 3d character models from the Unity asset store and add scripts to make them do what I want).

Enemies ScreenShot

A total of 7 Towers.

Tower Screenshot

The 11 enemies all have animations, including a running animation that loops while the enemy navigates their way to the end zone. Health and movement speeds have been set up, but haven’t been tweaked yet. The game is too early into development to set proper amounts which will result in balanced game play.

The 7 towers all have animations, some have been set up, some have not. All of the towers pick an enemy to shoot and creates a projectile (or a lazor!) that moves towards (and tracks and rotates towards) the enemy target. Each tower has a certain amount of muzzle’s that the projectiles will be instantiated at. Each time a projectile is instantiated, it is at a random muzzle out of total amount of muzzles that the particular tower has. When the projectile collides with the enemy they take damage and if the enemy has no health they die. I’m hoping to play a death animation when the health is zero, but want the tower to recognize that the enemy is dead and change its focus to a different enemy that is alive. I hope that this is a simple as creating a bool that says the enemy is alive, and only make towers attack an alive target. When the enemies health is zero, switch the bool to true and play a death animation, when the animation is complete, destroy the object.

Problems encountered {

Literally none that were too difficult to figure out. Sure there were a few bugs and errors here and there, but I knew exactly what and where was going wrong.


Plans for this week {

Shape the landscape.

Make a layout (Path) that the enemies will run through (I.E. checkpoints). Using a similar method that we have in place for the spider in our side scroller game.


This weeks song:

Until next time –




Image source:

Fiery 9. (2012). Retrieved from

Angry Spider. Retrieved from

Lyness, N. (2015). Side Scroller Spider Agro Zone Screenshot. Retrieved from

Waving Bear GIF. Retrieved from

Lyness, N. (2015). Side Scroller Spider Attack(2) Animation Screenshot. Retrieved from

Lyness, N. (2015). Tower Defense Enemy Lineup Screenshot. Retrieved from

Lyness, N. (2015). Tower Defense Tower Lineup Screenshot. Retrieved from


Video source:

Alien Ant Farm – Smooth Criminal. (2009). Retrieved from



Posted by on November 18, 2015 in Uncategorized


GAM 111.3 Reflective Development Logbook Blog 7 (Week 8)

*Startled Noise*

Week 8?! Where did you come from?!

Back at uni and on the stretch to finish this trimester.

Week 8’s class was a rather interesting class. We had a small unity project framework provided –


A 3D Side Scroller. The skeleton asset came with a 3D model skeleton ready to import into the game and 8 animations ready to be connected. The lecturer had already had functionality to move left, right, and jump.

What we added {

Parenting  to a platform that the skeleton is standing on, so if the platform ever moves the skeleton moves with it instead of the platform moving underneath (or other ways) while the skeleton stays in its current position.

Animations : Using an Enumerator (or Enum), which lets us store variables with names that we can recognize, and switch between which enum is activated using code. So when a certain enum state is selected, the skeleton will play an animation. (Lucky we learnt about animations the week after I started to use them at home by myself).

Camera Tracking: Makes the camera follow an object (in this case, the skeleton) without making it a child of the object. It’s coded to follow its location and stay at a distance.

Enemy: An enemy (spider) that currently does nothing but die when the player attacks it.

Setting up the collision detection for the sword was slightly complicated. Attaching a box collider to where the sword in the skeletons hand didn’t work. Unity would remember where the sword was before the game started, but once the game started and the animations started to move the skeletons limbs, the box collider would stay where the original position of the sword was. I found a fix for this. A box collider moves with the movement of the skeletons hand, and by attaching a box collider to the skeletons hand and moving and shaping its position to the same as the swords caused it to work the way I wanted.

I also had to turn that particular box collider into a trigger so during the idle animation of the skeleton, the sword wasn’t constantly colliding with objects in the game world and moving the location of the entire skeleton (all whilst making it look ridiculous).

Now because the box collider on the sword was a trigger, every time it entered the spider it was doing damage, even if the skeleton wasn’t attacking. So a boolean had to be used (which is a true or false statement) to identify that the skeleton is in fact attacking. If the attack animation was playing (which made the bool true) and the object that the sword’s collider was touching was the “Spider”, then the damage was dealt and a sound was played. When the spider had no health, he died and played a death animation. Poor Spidey.



Spiderman cry


Assignment number 2 has been revealed to us!

Carlton Dance

Quote : “A single-player 3D top-down isometric perspective game with a focus on economically achievable goals and strategic play. Possible game examples that could fit this design brief are quite diverse, ranging from Real Time Strategy Games (Starcraft 2, Command and Conquer series) to base/city building simulations (Cities: Skylines, Banished).”


What has two thumbs and is about to start making a ‘Tower Defense’ game?


I was/still am a big fan of Warcraft III ‘Wintermaul’ & ‘Line Tower Wars’ and other tower defense games.

WintermaulLine tower wars

Wintermaul Tower


So, I’ve gone ahead and made a start, incorporating a lot of the things we have learnt in the last few weeks of lessons.


Having an enemy use a NavMesh to navigate its way to a location in the game world.

Raycasting and instantiating a projectile to resemble a turret, or in this case, a ‘Tower’.

Having a certain amount of lives and losing lives when an enemy enters the end zone.


Plans for this week {

Add a heap of assets for enemies and configure some animations so it feels more of a game already rather than just a project with basic shape moving. (It’s amazing how much it makes it feel more like a game just by added a few visual aesthetics)

Make the projectiles track the enemy locations and rotate towards them so a shot never misses, but if a projectile is in the process of moving towards an enemy and the enemy dies before the projectile hits it, make it finish its trajectory forward without tracking another enemy.

Set up a few more towers with different functions and ways for shooting with different projectiles.

Make the projectiles deal damage to enemies.

Kill the enemies when their health is zero.


This weeks song :

Until next time –





Wikipedia,. (2015). Side-scrolling video game. Retrieved 12 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 12 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 12 November 2015, from,. enum (C# Reference). Retrieved 12 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 12 November 2015, from

Technologies, U. Unity – Scripting API:. Retrieved 12 November 2015, from


Image source:

Lyness, N. (2015). Side Scroller Class Project. Retrieved from

Lyness, N. (2015). Spider Death Animation Screenshot. Retrieved from

What Culture,. Sad Spider Man. Retrieved from

GIPHY,. Sad Spiderman GIF. Retrieved from

Carlton Dance GIF. (2015). Retrieved from

What has two thumbs. (2013). Retrieved from

Wintermaul TD. (2007). Retrieved from

Line Tower Wars. (2009). Retrieved from

Northrend Tower Defense Map. (2010). Retrieved from

Lyness, N. (2015). Tower Defense Progress Screenshot(1). Retrieved from

Giggle animated GIF. Retrieved from


Video source:

Slipknot – Before I Forget [OFFICIAL VIDEO]. (2006). Retrieved from


Leave a comment

Posted by on November 12, 2015 in Uncategorized


GAM 111.3 Reflective Development Logbook Blog 6 (Week 7)

Study Week!

No uni classes this week and all assessments have been completed and submitted. So what is there to talk about this week?

We’ll how about how I’ve partly transformed the first player shooter we had been working on in class into a zombie survival?!


That’s what I thought too guys,


So in the previous version of the shooter allowed the game to start with the player equip with an AK74u with an infinite amount of re-loadable ammo, well not any more! Not only does the player have a certain amount of ammo to use, reloading has full functionality. Reloading with any amount of ammo left in the clip or in reserve ammo calculates correctly.

For something that seems so simple, figuring it out for the first time is a little bit of a head-scratcher, in terms of it working correctly.

At first i thought it would be simple enough to stick with the two variables that had already been set up that track the current amount of ammo in the clip (and the new variable I made for reserve ammo). But that proved to be too difficult, it worked perfectly for the 50 percent of reloading. But when it came to reload when the reserve ammo is less than clip size but the clip is half empty, reserve ammo would fall into negative numbers in order to restore the current ammo to the maximum clip size.

So I decided to add a third variable that would track the amount of shots that have been fired. Whenever a shot was fired, the number tracking variable was incremented by 1. Whenever the player reloaded, the shots fired number tracking variable was reset to 0.

This ended up being the code (nestled in among many other lines of code)  that works perfectly –

//Refill current ammo with maxclipsize
player.reserveAmmo -= shotsFired;
player.currentAmmo += shotsFired;
shotsFired = 0;
if (shotsFired >= player.reserveAmmo)
shotsFired = player.reserveAmmo;
player.currentAmmo += player.reserveAmmo;
player.reserveAmmo -= shotsFired;
shotsFired = 0;

– The reserve ammo is decreased by the amount of shots fired.

– The current ammo is increased by the amount of shots fired.

– The shots fired variable is set to zero.

– If shots fired is greater than or equal to the players reserve ammo.

– The amount of shots fired will never be greater than the reserve ammo (stops it from going under zero).

– The remaining reserve ammo is added to the current ammo.

– The reserve ammo is subtracted by the amount of shots fired (which has been capped at the amount of reserve ammo left)

– The shots fired variable is set to zero.

Along with full functionality of reloading, enemies now have the appearance of a zombie, with some walking animations and a zombie groaning sound. The zombie asset pack that I have imported from the unity store came with quite a few animations, but I’m not sure how to use multiple animations or make certain animations play when certain things happen. So for now the zombies are just in a constant walking state until I shoot them to their death.

I’ve also added a way for enemies to drop little squares (ammo) that when the player comes into contact with them it will give the player reserve ammo. But the way that the player controller has been set up seems to interfere with the collision detection between the player coming into contact with objects which results in not being able to collect ammo at all.

Other than that, I have expanded the play field, added a building with a ramp onto a roof and re-baked the navmesh agent on the enemies to recognize all of the addition objects they need to navigate.

This weeks song:

Until next time –




Image source:

Lyness, N. (2015). Zombie New Layout Screenshot. Retrieved from 

Lyness, N. (2015). FPS Shooter Ammo Screenshot (1). Retrieved from

Lyness, N. (2015). FPS Shooter Ammo Screenshot (2). Retrieved from


Video source:

Tenacious D – Tribute. (2010). Retrieved from

Leave a comment

Posted by on November 3, 2015 in Uncategorized