Assignment 10: “Portal, The ProBuilder Update”

Objectives

  • Create your own level in a new scene using ProBuilder and ProGrids!
  • Ensure that the level has an FPSController to navigate with in the scene.
  • Ensure that there is an object or region with a trigger at the very end that will trigger the end of the level (some zone with an invisible BoxCollider will work).
  • When the level ends, display “You Won!” on the screen with a Text object.

Getting Started

GitHub Classroom

In this course, we’ll use GitHub Classroom to distribute projects and collect submissions. To begin Assignment 10:

  1. Click here to go to the GitHub Classroom page for starting the assignment.
  2. Click the green “Accept this assignment” button. This will create a GitHub repository for your project. Recall that a git repository is just a location where your code will be stored and which can be used to keep track of changes you make to your code over time.
  3. Click on the link that follows “Your assignment has been created here”, which will direct you to the GitHub repository page for your project. It may take a few seconds for GitHub to finish creating your repository.
  4. In the upper-right corner of the repository page, click the “Fork” button, and then (if prompted) click on your username. This will create a fork of your project repository, a version of the repository that belongs to your GitHub account.
  5. Now, you should be looking at a GitHub repository titled username/assignment10-username, where username is your GitHub username. This will be the repository to which you will push all of your code while working on your assignment. When working on the assignment, do not directly push to the games50/assignment10-username repository: always push your code to your username/assignment10-username repository.

Setup

Time to pull down the starting code for Portal! First, on your main repository page (https://github.com/username/assignment10-username), click on the green “Clone or download” button. Copy the “Clone with HTTPS” link to your clipboard (if familiar with SSH, you can use that instead).

Then, in a terminal window (located in /Applications/Utilities on Mac or by typing cmd in the Windows task bar), move to the directory where you want to store your project on your computer (recall that the cd command can change your current directory), and run

git clone repository_url assignment10

where repository_url is the link you just copied from GitHub. You will be prompted for your GitHub username and password

Go ahead and run cd assignment10 to enter your repository.

Becoming a Pro

Welcome to your tenth and final assignment! This assignment is going to be a fun conclusion to what’s been a challenging but hopefully exciting term! Rather than build upon Portal in this example, and to afford you some extra time for your final project (and hopefully save a little stress!), we’re going to leverage some of Unity’s brand-new tools to create a level! ProBuilder and ProGrids are a key feature that’s changed the game for Unity, and having them makes creating game worlds (and more!) all the easier.

Your goal this assignment:

  • Create your own level in a new scene using ProBuilder and ProGrids! The distro should already have ProBuilder and ProGrids imported and ready for use, but just in case they aren’t, you can easily find them by searching in the Asset Store (where they are now free, thanks to Unity having acquired them!). There are many resources for learning how to use ProGrids effectively, but two resources in particular that are worth checking out are here and here, which should more than prepare you for creating a simple level.
  • Ensure that the level has an FPSController to navigate with in the scene. This part’s probably the easiest; just import an FPSController from the Standard Assets! It should already be imported into the project in the distro, where you can find the prefabs under Assets > Standard Assets > Characters > FirstPersonCharacter > Prefabs!
  • Ensure that there is an object or region with a trigger at the very end that will trigger the end of the level (some zone with an invisible BoxCollider will work). This one should be easy as well, just relying on the creation of an empty GameObject and giving it a BoxCollider component, which you can then resize via its resize button in the component inspector!
  • When the level ends, display “You Won!” on the screen with a Text object. Recall that OnTriggerEnter is the function you’ll need to write in a script you also associate with the BoxCollider trigger, and ensure that the BoxCollider is set to a trigger in the inspector as well! Then simply program the appropriate logic to toggle on the display of a Text object that you also include in your scene (for an example on how to do this, just see the Helicopter Game 3D project, specifically the GameOverText script)!

How to Submit

Step 1 of 1

  1. Go to the GitHub page for your username/assignment10-username repository (note: this is different from the games50/assignment10-username repository).
  2. On the right side of the screen, click the Pull request button.
  3. Make sure that the “base fork” is games50/assignment10-username, and the “head fork” is username/assignment10-username.
  4. Click “Create pull request”.
  5. On the next page, click the “Create pull request” button again.

Congratulations! You’ve completed Assignment 10.