Exercise 4: Putting it all together

TWO WEEK EXERCISE

GAME 615 - American University

Description

This exercise is meant to give you the opportunity to creatively apply all of the topics we've covered so far. The goal is to apply every one of the topics we've covered in class into a small game. The exercise will take place over two weeks and you will be expected to come to class with Part 1 complete on week 1 and Part 2 complete on week 2.

Part 1

Name your Unity project "exercise04".

In Part 1 of the assignment, create as much of a game as possible that applies at least half 12 of the topics from class. This will involve conceiving of a small game that is made up of these technical topics. Constraints breed creativity!

In class, be prepared to describe what you are attempting to create by the following week, as well as being able to specifically point out how you applied your 12 technical topics. We will spend the majority of class helping one another understand the remaining topics.

Part 2

Apply the remaining technical topics, and complete your small game.

Topics from Class

  1. Creating and modfying 3d primitive shapes in the Unity Editor
  2. Creating and applying materials to Game Objects
  3. Applying and configuring Rigidbody Physics components to Game Objects
  4. Creating and applying custom components to Game Objects
  5. Response to player input (Input.GetKeyDown(), Input.GetKey(), Input.GetAxis())
  6. Making use of a game object transform's 'forward' vector
  7. Computing the vector between two objects (and normalizing it)
  8. Scaling a movement vector by Time.deltaTime (through multiplication) in order to ensure smooth continuous movement
  9. Using gameObject.GetComponent() to get references to other components from within a custom component
  10. Using GameObject.Find() to get references to other game objects in your scene
  11. Directly giving a custom component a reference to another game object by declaring a 'public GameObject' variable in your comonent, and assigning the value to that reference in the Unity Editor (Inspector)
  12. Making use of Random.Range() and Random.value to get random numbers
  13. Creating user interface elements
  14. Buttons: Calling a custom function when a button is clicked (the function needs to be 'public')
  15. Downloading and applying custom fonts to Text objects
  16. Downloading and importing 3D models from Google Poly
  17. Positioning an object's origin by creating empty game objects, and repositioning 'child' objects (this is necessary with many Google Poly models)
  18. Creating and configuring colliders (all game objects need to have a collider in order for Unity to recognize collisions - primitive 3d shapes have these by default, but imported Google Poly models need you to manually apply one)
  19. Creating prefabs
  20. Instantiating and configuring prefabs
  21. Triggers: Making it so the OnTriggerEnter function is called when two objects collide
  22. The timer pattern: Create a float variable with a value of the time you want to count down from. Decrease that variable by Time.deltaTime in your Update function. When that variable is less than zero, perform the action you want to have happen, and reset the countdown variable.
  23. C# Programming:
    1. Variables (creating, using, and modifying them)
    2. Conditional statements and boolean expressions (i.e. controlling when code is ran based on the value of variables)
    3. Calling functions (e.g. rigidbody.AddForce())
    4. Implementing functions Unity automatically calls (e.g. Start, Update, and OnTriggerEnter)
    5. Objects: Collections of variables and functions stored within a variable (e.g. Vector3, Color, Rigidbody, Material, Randerer, etc.)
    6. Modifying objects and calling their functions using the dot ('.') syntax
    7. Iteration: Repeat a section of code until a boolean expression evaluates to false

Building your Project for the Web

Submission

Submit your project to github. Make sure your Unity project is titled "exercise04" and located in the "exercises" folder of your local github repository. To push it up to github, open Github Desktop, commit your changes (you need to enter a comment in the field on the bottom left of the screen), and click the "Push origin" button near the top middle of the screen.

If everything worked, you should be able to play your game by going to:

http://(your git username).github.io/game615-spring2019/exercises/exercise04/web

Mike's Exercise 4

I'll also be creating a small game along with you. I will periodically update the project, and it may be a helpful to puruse my code base to see how I am working with the limited topics we've covered to achieve neat effects.

CODE PLAY