GAM 111.3 Reflective Development Logbook Blog 9 (Week 10)

24 Nov

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


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 )

Google+ photo

You are commenting using your Google+ 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: