Class hours: 9:40 – 2:05
Mr. Bohmann
wbohmann@ewsd.org
Today’s Notes
- Today is an EHS A Day
- May 3rd CVU students do not have school (CVU is off), there is no transportation but if you can get here, we’d gladly welcome you.
- Halfway through Quarter 4 – Check PS if want to know where you stand
- Senioritis – I see it. Hang in there
9:40 Attendance
9:45 Unity – 45 minute design / code Challenge!
![](https://cawdvt.org/wp-content/uploads/2022/02/unity-logo-1230x690-2-1024x574.jpeg)
Do you remember what my favorite Arcade game is? I mentioned it yesterday. Arkanoid!
![](https://cawdvt.org/wp-content/uploads/2022/04/blocks.png)
We’ve got enough skills to create a nice little breakout game – or at least a minimal viable product to see how everything works.
Let’s start together by creating our very own sprite sheet of the assets we will need. There is a little math involved, but Math is cool, so there is nothing to really worry about. We’ll use Photoshop.
Create a New Scene called BreakOut in the Game Programming project
Sprite Assets we need to create: Ball, colored blocks, paddle, border
Physics Material (Bouncy) for the Ball
For the paddle we are going to use a Polygon Collider and I’ll demonstrate why…
Code we need to create: Movement Script for Paddle, Collision Script to Destroy Blocks and A Ball Script
PreFabs will make our life easier by creating one for each block to include:
- Correct Scale
- Box Collider 2D
- Collision Script
Background Image – here is one you can use
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ball : MonoBehaviour
{
// Movement Speed
public float speed = 10.0f;
// Use this for initialization
void Start()
{
GetComponent<Rigidbody2D>().velocity = Vector2.up * speed;
}
}
This code is going to use a Vector to move the ball up at the start of the game. We can use the speed variable to change the speed of the ball.
![](https://cawdvt.org/wp-content/uploads/2022/04/Screen-Shot-2022-04-28-at-6.08.11-PM-1024x639.png)
Build, Play Test
10:35 Break
10:45 Quick Quiz – Let’s see what you remember from this week…..
Today’s assessment are concepts and questions we reviewed in class this week. Take your time to read through each question and answer before responding. When you finish, you can continue working on your BreakOut Game or continue working on building out around your track.
![](https://cawdvt.org/wp-content/uploads/2022/04/prototype-vs-crchetupye-1024x542.png)
11:30 Karting Game Track & Materials
By now you have your track created but your environment is probably pretty basic. We don’t have to deliver a finished product, but we can deliver a very nice Prototype bordering finished product by filling out our scene. Let’s add:
GameObjects that enhance the look for your scene (buildings, models, trees, blimps, clouds, bleachers, etc… we made a long list yesterday.
Don’t forget the class created many shared models in from the Animation PSA competition.
Next, let’s talk about materials / making materials and assigning materials to your objects.
By default (and depending what type of project you load) most materials are assigned to the Standard Shader. A Shader is built in program that calculates the appropriate level of light, dark and color during the render of your scene. Basically how the pixels of the surface of the model should look.
![](https://cawdvt.org/wp-content/uploads/2022/04/StandardShaderNewEmptyMaterial.png)
Unity has other built in shaders:
- FX: Lighting and glass effects.
- GUI and UI For user interface graphics.
- Mobile: Simplified high-performance shader for mobile devices.
- Nature: For trees and terrain
- Particles: Particle system effects.
- Skybox For rendering background environments behind all geometry
- Sprites For use with the 2D sprite system
- Unlit: For rendering that entirely bypasses all light & shadowing
- Legacy: The large collection of older shaders which were superseded by the Standard Shader
Materials are used in conjunction with shaders. Most shaders come with a list of material parameters.
- Albedo is color or can be an image
- Metallic and Smoothness refer to how metal like an object is and how much light refraction
- Normal Maps can be used to make a surface look like it has a texture or bumps when light hits it
- Height Maps are used like a normal map and will give additional definition to a surface
- Occlusion Map is used to provide which areas of a model should receive high or low indirect lighting that comes from light reflections
Textures are applied to objects using materials. Unity can import textures from most common image file formats. Here are a couple places to get textures for making materials:
Keep your materials and your textures organized.
12:15 Lunch
![](https://cawdvt.org/wp-content/uploads/2021/08/sandwhich-1.jpeg)
12:45 Focus on Literacy
![book covers](https://cawdvt.org/wp-content/uploads/2022/01/books.png)
1:05 Mask Break
![](https://cawdvt.org/wp-content/uploads/2020/08/mask900-1.gif)
1:15 Production Time & Guided Support
- Karting custom track build – Due Today with 3 Modeled Objects
- Did you show me Alien Dance?
- Career Exploration – Game Careers due Today
- Week 32 Agency Project – Due May 2nd
- Past Due work – check PowerSchool. P4 closes Today – email me if you complete work that needs to be graded.