https://github.com/normandy72/delivery-driver
A "Delivery Driver" game. Complete C# Unity Game Developer 2D.
https://github.com/normandy72/delivery-driver
csharp csharp-code game-development gamedev unity unity2d unity2d-game
Last synced: about 2 months ago
JSON representation
A "Delivery Driver" game. Complete C# Unity Game Developer 2D.
- Host: GitHub
- URL: https://github.com/normandy72/delivery-driver
- Owner: Normandy72
- Created: 2023-01-07T18:35:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T21:20:33.000Z (over 3 years ago)
- Last Synced: 2025-06-04T17:45:58.006Z (about 1 year ago)
- Topics: csharp, csharp-code, game-development, gamedev, unity, unity2d, unity2d-game
- Language: C#
- Homepage:
- Size: 332 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Driver.cs
##### Debud.Log(message);
* Output some info into console.
##### Time.deltaTime
* Using `Time.deltaTime` Unity can tell us how long each frame took to execute.
* When we multiply something by `Time.deltaTime` it makes our game "frame rate independent".
* Ie. The game behaves the same on fast and slow computers.
***
### Collision.cs -> was renamed to Delivery.cs
##### OnCollisionEnter2D Method
* Collision action.
##### OnTriggerEnter2D method
* Actions when interacting with a trigger.
##### If Statements
If statements let us check if something is true or not and then do something based upon the result.
```
if(this thing is true)
{
do this thing;
}
```
##### Why Use Tags?
Tags allow us to easily check in code if something belongs to a particular category of thing.
##### What Is a Bool?
* Bools are types of variables that can store one of two values - true or false.
* They are often used with if statements to decide whether something happens or not.
##### Destroying Game Objects
* We call `Destroy()` to delete game objects from the scene.
* `Destroy()` requires us to tell it ("pass in") 2 things:
* Which game object to destroy.
* How much delay until its destroyed.`
Example: `Destroy(theMonster.gameObject, 0.5f);`
***
### FollowCamera.cs
##### Creating a reference
If we want to access / change / call anything other than this game object's transform, we need to create a reference.
Ie. we need to tell Unity what the "thing" is that we are referring to.