VG1, Quest 2 - Physics Maze

Download Files

Supporting files for VG1 quests are part of a single archive that you can download here.

Create Scene

Using the same Project as before, create Q2 in the Scenes folder for this exercise.

Double-click Q2 and check the Hierarchy to make sure you are working on the expected scene.

Setup Folders and Import Files

Import the supplied Q2 graphics into the /Assets/Textures/Q2/ folder.

Ship Sprite Settings

Select the ship0 sprite in the Project tab and configure it in the Inspector tab. Change the PPU to 48 so that the graphic is properly sized. The Filter Mode should be Point because the graphics are pixel art. Set Compression to None to maximize graphics quality.

Environment Sprite Settings

Note the use of a new setting "Multiple" for Sprite Mode.

Multi-Slice Sprites

Check all the settings. Be sure Sprite Mode is set to "Multiple."

Click "Sprite Editor" in the Inspector tab to open the Sprite Editor tool.

Click "Slice", set Type to Automatic, and Click the Splice button.

If you click an individual graphic, you will notice it is sliced as its own sprite.

Sprite sheets can be expanded to reveal individual sprites.

Set Aspect Ratio to 16:9

This helps ensure consistent screen boundaries across different devices.

Create Player GameObject and Components

The order components are added is important. The collider knows what shape to take based on the sprite that is assigned in the Sprite Renderer.

Create Player Script

Create RotatingShipController.cs in /Assets/Code/Q2/

Attach and Configure Player Script

PlayTesting "Game Feel"

While the game is running, try different Linear Drag and Angular Drag values on the Player's Rigidbody2D as well as different Speed and Rotation Speed values on the Ship Controller. Notice how changing these values drastically affects the "Game Feel".

Although they are subjective, the values supplied in these instructions represent a deliberate attempt to create an appropriate experience for the player.

When you stop playing the game, these numbers will reset to their pre-execution values.

Create Obstacle GameObject

Create an Obstacle GameObject. Set the Sprite before adding the PolygonCollider, so the engine knows what shape to generate.

Create Maze Obstacle Script

Create MazeObstacle.cs in /Assets/Code/Q2/ and attach it to the Obstacle object.

Our Obstacle objects will check for Collision events with the Player and reload the Scene.

Scene Setup

The SceneManager can only operate on scenes enabled in the Build Settings. Go to File > Build Settings.

Ensure the current Scene is listed in "Scenes in Build" and is checked. You can drag scenes in from the Projects tab.

Level Design

Create a challenging Level Design in which the Player must navigate through Obstacles to reach a Goal. You do not need to script the Goal for this assignment. A Goal graphic is all that is necessary. You are required to use all six asteroid variations. You must ensure all the asteroids have a collider shape that matches their graphic.

PlayTest

PlayTest your Level Design and adjust Level Layout and Player Physics until you are satisfied with the Game Feel.

Create Level Boundaries

Ensure your Game tab is set to an Aspect Ratio of 16:9.

Obstacles do not always have to have graphics. In this step, we will create an example of a physical obstacle that has no visual.

Create Obstacles that represent the level boundaries by making a GameObject that has 2D BoxColliders but no SpriteRenderer. Use the "Edit Collider" button to shape the Collider. DO NOT use the Transform Scale to stretch it.

Finalize all four level boundaries. Ensure there are no gaps where the ship could fall out of the level.

Play your game again with the added difficulty and adjust balance for game feel.

Save and Test

Playtest to ensure all interactions work as expected and that the addition of any new features hasn’t broken any earlier interactions.

Submit Assignment

SAVE any open files or scenes.

Submit your assignment for grading following the instructions supplied for your particular classroom.