Exercise 6: Race to Collect!

GAME 615 - American University

Description

Description

For this assignment, you will implement a "race to collect something" between the player and an army of "enemies". On the screen should be at least two numbers: one for the number of items that the player has collected, and one for the number of items the enemies have collected. When all items have been collected, something should happen based on whether the player or the enemies have collected more items. It is up to you how you want the player to move (i.e. feel free to use the Unity starter assets, or the point and click method I demonstrate in the 2-22-23 example).

The main two new concepts that you will need to explore are:

  1. Using a "GameManager" script to centralize global variables (such as playerScore and enemeyScore) and update UI elements.
  2. Having external scripts update those variables.
  3. Using Unity's NavMesh Navigation AI system to control enemy movement

To create the Enemy behavior, you can make use of EnemyScript.cs located in the example project for 2-22-23. Any GameObject with that script and a NavMeshAgent component will choose a random location periodocally on the NavMesh and move there. You will need to make it so the enemy will "collect" the collectable items and update the GameManager (and the UI) accordingly. If you need review of how to do that, see the PlayerController.cs file in the 2-22-23 example.

Requirements

Configuring your project

Name your repository "game615-spring2023-06"

Make sure to set your Unity and Github projects correctly. BE EXTRA REALLY SUPER CERTAIN THAT YOUR GITIGNORE FILE IS CONFIGURED CORRECTLY AND PLACED IN YOUR UNITY PROJECT FOLDER (the same one as assets)

Building your Project for the Web

Submission

Turn in this assignment via your properly named GitHub repository. Each submission must be accompanied by a README.md file that contains your name, the name of your collaborators, and a link to a playable version of your game (i.e. a WebGL build). Also include any other information you think may be relevant (e.g. how to play if it isn't obvious).

Also, as part of your submission process, you must complete this form. In the form there is a place to link your repository - this is where I will look to see your submission.

Sample Code

CODE PLAY