Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion GameDev/week3/homework/issues/ReadMe.md

This file was deleted.

6 changes: 6 additions & 0 deletions GameDev/week3/homework/issues/homework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Week 3 Homework
- Create a boost function that doubles the speed of the car if you're holding the Space key.

- Create an original game using the design document template we've provided.

- Create a project for the game you create in the design document and try to find and import assets that you could use.
31 changes: 31 additions & 0 deletions GameDev/week3/homework/issues/starter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
//Variables
public float speed = 15.0f;
private float turnSpeed = 25.0f;
private float horizontalInput;
private float forwardInput;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");

// We move the vehicle forward
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput);

//We turn the vehicle
transform.Rotate(Vector3.up, Time.deltaTime * turnSpeed * horizontalInput);
}
}
1 change: 0 additions & 1 deletion GameDev/week3/homework/issues/starter/temp.md

This file was deleted.

93 changes: 93 additions & 0 deletions GameDev/week3/homework/solution/solutions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Assignment 1: Car Boost

## Solution 1:


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
//Variables
public float speed = 15.0f;
private float turnSpeed = 25.0f;
private float horizontalInput;
private float forwardInput;
private float boostInput;
private float boost;


// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
boost = 1.0f;
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");
boostInput = Input.GetAxis("Jump");

boost += boostInput;

// We move the vehicle forward
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput * boost);

//We turn the vehicle
transform.Rotate(Vector3.up, Time.deltaTime * turnSpeed * horizontalInput);
}
}

## Solution 2:


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
//Variables
public float speed = 15.0f;
private float turnSpeed = 25.0f;
private float horizontalInput;
private float forwardInput;
private float boostInput;
private float boost = 2.0f;


// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");
boostInput = Input.GetAxis("Jump");

// We move the vehicle forward
if(boostInput > 0f)
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput * boost);
else
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput);

//We turn the vehicle
transform.Rotate(Vector3.up, Time.deltaTime * turnSpeed * horizontalInput);
}
}

# Assignment 2: Project Design Document

Given the nature of the assignment, there is no set solution. The assignment only needs an original game planned out in the project design document template we provide.

# Assignment 3: Importing Assets

Like the second assignment, there is no set solution. The assignment only needs a Unity project that has assets in it that could be used to develop the game that the students planned in assignment 2.
1 change: 0 additions & 1 deletion GameDev/week3/homework/solution/temp.md

This file was deleted.

Loading