Class hours: 9:40 – 2:05
Mr. Bohmann
wbohmann@ewsd.org
Week Twenty Two
Today’s Notes
- Today is an EHS A Day
- Tom – Meeting at 10:30 on Friday
- Congratulations to Andy, Finn and Ryan – Perfect Attendance for Quarter 2!
- Food Drive is ongoing – Thanks Ryan and Lance for donations. If you want to donate to the food shelf and help those who need it in our community – please consider donating an item
- Visitors – we have visitors from Milton
- 10:05 2 Visitors today working with Matt/Ryan in tandem
- EWSD accounts – if you are an EHS student, likely you have a network account. This is needed to sign in to make Visual Studio compatible with your Unity Installation. The IT department will work with you one and one this morning. Don’t forget your password! Don’t forget your password!
9:40 Attendance
9:45 Skills USA Kicks off
Each Thursday morning SkillsUSA Design Competition prep work will come out.
By Friday at lunch – create a folder with your two names on the Public inside of the weeks “skillsUSA” folder. The folder is found at Public/CAWD. For example if Mr. Cronin and Mr. Bohmann were working together the folder would be:
- “croninBohmann”
Create your folder in the discipline you are working in. DO THIS FIRST
Skills USA is a production grade that counts towards your Q3 grade. How much? – 20%. Your work will be graded on completion of deadlines, adherence to deliverables and your ability to work independently and with your partner. Time is limited, so use your production windows well. We’ll do Skills every Thursday & Friday up to the competition date in April. You’ll be graded on your work each week. Skills counts as 20% of your Quarter grade.
Skills Work for that week will always be due at 12:10 on Friday’s.
Watch the Time!
Once we pair up we are going to have a different task based on which event you and your partner wish to compete in.
This first week is really to get a working relationship with your Partner – most if not all of the team work will be done on a single computer this week. Sit together.
See Mr. Cronin’s Dayplan for specifics – read carefully
See Mr. Cronin’s Dayplan for specifics – read carefully
Create a web page with your Team Profiles. This project should push yourselves to create something visually attractive, and full of information about your team. Images of you and your partner or logos of you and your partner or something that represents you.
- Identify Who will be the Web Developer (In charge of the html and JS) – Web Dev does this part.
- Identify Who will be the Web Designer (In charge of more of the artistic choices and styles – CSS) – Web Designer does this part.
- Impress us with what you can create.
- Include a brief bio of each team member so we can learn about you
Upload your completed project to your team folder. It is only one page.
- Your page will be called index.html
- Images will be in an images folder
- CSS will be in a css folder
- Include an image for your planning document – we’ll call this a rough wireframe (this means you will sketch your design on paper with a rough layout BEFORE you begin coding.
As always, validate your code – HTML / CSS. Practice commenting and organizing your code.
10:35 Break
10:45 Unity – Day Two
Today we’ll learn a bit about prefabs and dive in to our first bit of code. To help, I’ve included some code references below.
Let’s add a player and add a jump mechanic using the space bar.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CapsulePlayer : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Debug.Log("My Player is here");
}
// Update is called once per frame
void Update()
{
//check to see if the space key is pressed down
if (Input.GetKeyDown(KeyCode.Space))
{
Debug.Log("Hey you pressed the space key dummy!");
GetComponent<Rigidbody>().AddForce(Vector3.up * 5, ForceMode.VelocityChange);
}
}
}
Probably this is just not enough to make our game fun. We also can clean up our code – called refactoring! First we need to move the physics part into the Fixed Update method because that is for physics game objects.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CapsulePlayer : MonoBehaviour
{
//variables will go here
//will check to see if this is true by default it is true
private bool jumpKeyPressed;
// Start is called before the first frame update
void Start()
{
Debug.Log("My Player is here");
}
// Update is called once per frame
void Update()
{
//check to see if the space key is pressed down for every rendered frame
if (Input.GetKeyDown(KeyCode.Space))
{
jumpKeyPressed = true;
}
}
//fixed update is called once every physics update - takes account for physics!
private void FixedUpdate()
{
if (jumpKeyPressed)
{
GetComponent<Rigidbody>().AddForce(Vector3.up * 5, ForceMode.VelocityChange);
jumpKeyPressed = false;
}
}
}
Time to add some horizontal movement so there is more action to our game. Plus, we want our player to move around. This next bit of code will make our capsule like Flappy Bird, it is not what we want but it will be a good ending point for today.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CapsulePlayer : MonoBehaviour
{
//variables will go here
//will check to see if this is true by default it is true
private bool jumpKeyPressed;
//a float is a type of variable for decimals our player will not move in whole numbers
private float horizontalInput;
public bool JumpKeyPressed;
public float HorizontalInput;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
//check to see if the space key is pressed down for every rendered frame
if (Input.GetKeyDown(KeyCode.Space))
{
JumpKeyPressed = true;
}
HorizontalInput = Input.GetAxis("Horizontal");
}
//fixed update is called once every physics update - takes account for physics!
private void FixedUpdate()
{
if (JumpKeyPressed)
{
GetComponent<Rigidbody>().AddForce(Vector3.up * 5, ForceMode.VelocityChange);
JumpKeyPressed = false;
}
GetComponent<Rigidbody>().velocity = new Vector3(HorizontalInput, GetComponent<Rigidbody>().velocity.y, 0);
}
}
// our game has some bugs - we can see this when you play - we'll fix those and clean up the code next time
11:30 Skills Production continued…..
12:15 Lunch
12:45 Literacy in Practice
1:10 Break
1:20 20% Production Time & Guided Support
- PSA Modeling
- Overdue work
- Open Unity sometime during this hour go the the Asset Store and download the Starter Assets – First Person Character Controller. We are just adding them to the Package Manager and not our first project.
- 20%