class: center, middle # Creación de Videojuegos ### Unity --- class: center, middle # Unity - Introduction --- class: center, middle # Unity
--- class: small # Unity Used for: * Hearthstone * Pokemon Go * realMyst: Masterpiece Edition * Temple Run * Rust * SYNTHIA * etc. --- class: center, middle # Unity - Scene view
--- class: center, middle # Unity - Scene hierarchy
--- class: center, middle # Unity - Inspector
--- class: center, middle # Unity - Project
--- # Unity - Basics * A "level" in Unity is called a *Scene* * A scene consists of *Game Objects* in a hierarchy * Each game object has multiple *Components* - Transform - Geometry - Physics - Scripts --- # Physics Remember physics? $$ \vec{v} = \int \vec{a} \cdot \operatorname{d}t $$ $$ \vec{s} = \int \vec{v} \cdot \operatorname{d}t $$ $$ \vec{a} = 9.81 \frac{m}{s^2} \cdot \operatorname{down} $$ --- # Discretized Physics What if we have a loop that increments time by some small amount? $$ \vec{v} = \sum \vec{a} \cdot \Delta t $$ $$ \vec{s} = \sum \vec{v} \cdot \Delta t $$ $$ \vec{a} = 9.81 \frac{m}{s^2} \cdot \operatorname{down} $$ --- # Discretized Physics in code Very easy to do in Unity: ```C# acceleration = -9.81 * Vector3.up; velocity += acceleration * Time.deltaTime; transform.position += velocity * Time.deltaTime; ``` --- # Discretized Physics in code Problems to solve: * 2D? * Set acceleration to a better value * Handle user input (move sideways?) * Collisions? --- class: center, middle # Demo time ## Get the demo project on github:
https://github.com/yawgmoth/UnityDemo2D
--- class: small # Assets *
Unity Standard Assets
(terrain textures, water, vehicles, a 2D character, code samples, etc. You probably want this) *
2D platform assets
(character, blocks, enemies, coins, etc.) *
Another pack of 2D platform assets
*
Roads
(Free package with some restrictions; should work well for a racing game) *
Fantasy props
(walls, benches, etc.) *
Medieval town exterior
(buildings, well, buckets, etc.) *
Animated 3D Skeleton
* Search with "price:0" to find free assets! * My recommendation: Use art assets, but don't use code. You'll have to debug it when something goes wrong. --- class: small # References *
Unity 3D
*
Unity Tutorials
*
Unity 2D Extras
(Tilemap extensions) *
Unity 2D Tilemap Video Tutorial