Movement, Physics, Collisions, and Scenes
Exercise 2.0: Movement and Rigidbodies
- Create a ball (dynamic rigidbody, circle collider) that drops from the top of the screen.
- Before the ball falls off the bottom of the screen, make it do the following:
- Get hit by a moving rectangle (kinematic rigidbody moved via script and velocity)
- Hit at least three other platforms (static rigidbodies)
Please post a WebGL build to your website to turn this in. Find instructions for uploading here.
Exercise 2.1: Colliders, Triggers, and Tags [ View Demo]
- Create a rectangle that is affected by gravity ("the bird") and a static floor and ceiling below and above it.
- When you press "W" (or up arrow if you are having problems with W) give the bird a force upwards.
- Create a yellow circle that moves from one side of the screen to the other (see Exercise 2.0). If the bird hits it, it disappears.
- If the bird touches the floor or ceiling turn it red.
If the bird touches the ceiling, turn it green.
Please post a WebGL build to your website to turn this in. Find instructions for uploading here.
Exercise 2.2: Tags, Scenes [ View Demo]
- Create a paddle on the bottom of the screen which you can move left and right with the arrow keys using velocity.
- Add three objects above it:
- A blue cicle that falls via gravity. If it hits the paddle, it bounces off the paddle (or rests on it) and turns the paddle blue.
- A yellow cicle that falls via gravity. If it hits the paddle, it bounces off the paddle (or rests on it) and turns the paddle yellow.
- A green circle that move down slowly via velocity. If it hits the paddle it goes to another Scene that says "You win!" Note: Be sure to uncheck "Strip Engine Code" in the build settings to see your text.
Please post a WebGL build to your website to turn this in. Find instructions for uploading here.
Project 2: Movement Game
Create an avoidance game with collisions. Try to think about incorporating either an interesting movement mechanic (e.g., Duet, VVVVVV), or an interesting way of moving the things you have to avoid (e.g., JumpGrid, Super Hexagon). Please include at least two different levels using scenes (three is better). Make each level more difficult than the previous. You don't necessarily need to use a lot of physics, but, use triggers and colliders for collisions. If you're struggling with ideas, using rotation is often a good thing to embrace.
Figure It Out Yourself (FIOY). For each project, you’ll be asked to incorporate something in your project that we didn’t explicitly go over yet in class. When you post your project, please post a sentence or two on what you did and a link to the resource you used.
Grading Rubric
You will be graded on creativity, implementation, and experience.
Example Project
Here is a project you can use as reference. It's a avoidance game made in Unity similar to Duet.
References/Inspiration
Please post a WebGL build to your website to turn this in. Find instructions for uploading here.
In addition, please zip the Unity project and put it in the OneDrive folder you shared with me.