Metroidvania Toolkit

Learn to Code with C# and Design a 2D Action Platformer Video Game Using Unity 2020

Last updated 2022-01-10 | 4.8

- ****DISCOUNT AVAILABLE ON MY WEBSITE****
- Computer Coding and Code Architecture
- Unity Game Development

What you'll learn

****DISCOUNT AVAILABLE ON MY WEBSITE****
Computer Coding and Code Architecture
Unity Game Development
C# Code Theories
Complete Movement Controls for 2D Platformer
Object Pooling and Shooting Mechanics
Data Persistency within Unity
Enemy AI
World Map
2D Character Rigging
Inverse Kinematics
2D Animations and Keyframes
Random Drops when Enemies Die
Video Game Development Theories
Save/Load System with Multiple Game Slots

* Requirements

* A working computer that can run Unity's minimum system requirements.

Description

  • ****DISCOUNT AVAILABLE ON MY WEBSITE****
  • Computer Coding and Code Architecture
  • Unity Game Development
  • C# Code Theories
  • Complete Movement Controls for 2D Platformer
  • Object Pooling and Shooting Mechanics
  • Data Persistency within Unity
  • Enemy AI
  • World Map
  • 2D Character Rigging
  • Inverse Kinematics
  • 2D Animations and Keyframes
  • Random Drops when Enemies Die
  • Video Game Development Theories
  • Save/Load System with Multiple Game Slots

Course content

8 sections • 102 lectures

House Keeping/Course Overview/Unity Download and Install Preview 14:22

Please watch the first couple minutes of this episode even if you have a ton of experience with Unity; I go over valuable house keeping suggestions that will make you a more successful student.

After the first few minutes I'll go over a step-by-step guide on how to download and install Unity using their available free version for hobbyists; if you have Unity installed and are ready to start learning how it works, you can skip to episode 2 after the first few minutes.

If you have some experience and understand how to code/work within the Unity editor, then go ahead and skip to section 2 after the first few minutes of this episode.

Unity Editor Walkthrough Preview 09:49

A description of how each of the standard windows in Unity work and how we will use them throughout the series; at the end I will show you how I setup the windows for what I consider the most optimal workflow.

Introduction to Gameobjects and the Transform component Preview 08:37

In depth discussion of what a 'Gameobject' is, what the 'Transform' component does, and how these are the building blocks that make up everything for a game within Unity.

Building a Level and Parent/Child Relationship with Gameobjects Preview 14:53

Discussion on how gameobjects react with each other when they are parent/siblings/children of each other; using the simple geometric shapes Unity provides, we will build a level following these principles and test what we've learned so far at the end with a challenge.

Introduction to Coding Preview 11:16

I explain how a computer reads code through an analogy to help with initial comprehension on how to code and what it actually does.

How Computers Read Code Preview 08:01

We'll go over a blank script in Unity and explain how the computer processes the information in the script to execute commands.

Writing Our First Script Preview 14:13

We'll break the ice with writing code by going slowly going over simple movement and then explain what the different colors in the text represent.

Reviewing the Movement Script Preview 09:49

I'll go over line by line what the logic in the 'Movement' script means in laymen's terms.

How to Read API Documentation Preview 05:05

I'll go over how to API (application programming interface) documentation to help speed up learning unfamiliar topics and jump start using new methods/scripts.

Bools and Conditional Checks Preview 10:15

We'll learn about the 'bool' keyword and how to use true/false logic to change the color of the sphere when it is in motion.

Floats, Ints, and Trigger Colliders Preview 10:00

We'll learn about the difference between a 'float' value and an 'int' value as well as how we can control logic when the sphere enters inside a collider.

Setting Up UI and Discussing String References Preview 14:00

We'll setup UI to display the values of 'Time Left' and 'Score' as well as discuss how we can save the top score through 'PlayerPrefs'.

Using Vectors, Random Values, and Lights Preview 07:51

We'll discuss how to place the pickup cube randomly within the level using Vectors as well as add a spotlight to the cube to make it more visible within the level.

Brief Introduction to Particle System Preview 08:06

We'll discuss how to setup a particle system and I'll very briefly go over a few features of the system to put together an effect for the pickup.

Finishing the Gameplay Loop and Building Our First Game Preview 17:36

We'll discuss how to close up the gameplay loop with interactable UI that will respond to button clicks to start the game, retry when it is finished, or quit the application all together; we will also 'build' the game so you can play it outside of Unity.

Setting Up the Foundation for Metroidvania Tools Preview 09:48

We will design a very basic testing character and lay the foundation to build a code architecture that can be expanded and modulated to allow more complex movement methods be more easily managed.

Solving for Basic Movement, Else Statements, and Return Methods Preview 12:52

We will handle basic movement and discuss how to run code through an 'else' statement as well as how to feed a method certain information it will need in order to come up with the requested solution.

Solving for Facing the Correct Direction and Sprinting Preview 10:28

We will be able to flip the character to a leftward facing direction when moving left, as well as have the character's speed increase when a button we will define is held.

Solving for a Jump and Introduction to Layers and Raycasts Preview 13:18

We will talk about how we can manage when the player should be allowed to perform a basic jump.

Allowing Multiple Jumps and Protecting Jumping While Falling Preview 06:48

We will solve for allowing multiple jumps in the air based on the limit you set, and not allow to perform a jump in the air if the player is falling before performing the first jump.

Limiting the Jump and Fall Speeds Preview 06:41

We'll prevent the player from performing a higher jump when rapidly pressing jump button if jumps allowed are more than 1, and limit the speed in which the player can fall off a tall ledge.

Giving Jump More Height When Button Held Preview 06:35

Allow the player jump to perform the full jump when button held, and perform a smaller jump if tapped.

How to Rig a 2D Character Preview 13:16

We will import a character that we can use as a player, then I will describe the rigging process, how to setup bones and connect the different sprite parts to make the character.

Setting Up IKs for Better Bone Control Preview 06:28

We will setup the IKs (Inverse Kinematics) for the character to make controlling the different limbs and bones much easier.

Introduction to Animations, Keyframes, and Tweening Preview 12:10

We will discuss how to use animation tools to create fluid animations using 'keyframes' and 'tweening'.

Using the Animator Component to Trigger Animations Preview 11:02

We will discuss how to use the 'Animator' component to trigger the different animations and control what animations should be playing when.

Blend Trees and Setting up Jump/Falling Animations Preview 15:01

We will discuss how a blend tree can more smoothly and easily transition between two similar animations based on certain values.

Adding and Animating a Glide Ability Preview 11:11

We will code and animate a new ability that will slow the player's falling speed when the ability is active.

Coroutines and the Crouching Ability Preview 17:27

We will discuss what a coroutine is, how to use it, and code the crouching ability.

Animating and Controlling the Crouch State Preview 10:12

We will go over how to animate the crouch and when to trigger the crouching state.

Creating a Dash Ability Preview 12:43

We will discuss how we can create a quick dash ability and have it also pass through certain layers when active.

Animating the Dash Ability Preview 08:41

We will discuss how to animate the dash ability as well as how to change a 'CapsuleCollider2D' direction through code.

Wall Sliding and Wall Jumping Preview 17:06

We will code the features needed to perform a wall slide and then jump from the wall while wall sliding.

Animating and Triggering the Wall Slide Preview 11:44

We will animate the wall slide and discuss how can properly trigger the animation and have the character facing the correct way between wall sliding and not wall sliding.

Refactoring Input Into One Script Preview 14:54

We will be re-writing the input into one singular script and refactor our solution to move input detection from each individual script into this new 'InputManager' script.

Introduction to Lists and Arrays Preview 10:00

We will discuss what the difference between a list and an array, as well as get some practice by making a list and array of names and have the console window print a specified value.

Introduction to Scriptable Objects Preview 08:54

Introduction to Object Pooling System Preview 10:36

We will discuss the benefits of using an object pooling system to instantiate projectiles into the scene.

Getting Started with the Weapon Script Preview 13:20

We will start building up the 'Weapon' script which will contain all the data for a weapon inventory as well as placing projectiles into the correct position and rotation.

Instantiating Projectiles at Barrel of Gun Preview 15:29

We will discuss how we can use the 'Weapon' script to have the projectiles position and rotation match them with the gun.

Moving and Placing Projectiles Preview 11:47

We will discuss how can have the projectiles moving in forward direction when shot, but the gun barrel isn't positioned in front of the player.

Setting Up the Weapon Aiming Component Preview 14:10

We will setup new IKs to have the gun arm and other arm snap to a firing stance when weapon used so that the animations we already have can be used while the new IKs handle placing the gun.

Solving for Firing Projectiles Forward Preview 12:34

We will have both the arms positioned correctly and the projectiles firing straight forward in front of the player when weapon is fired.

Commenting Complicated Code and Unity Inspector Tips Preview 07:26

We will take a quick break from dense code and discuss how we can add comments to the scripts themselves to note what certain methods or variables do, as well as add inspector tips so that we can leave a note on how certain components work in the inspector window, or have quick notes pop up when mouse is hovering over certain variables or methods in the inspector window.

Solving for 8 Directional Aiming Preview 09:59

We will discuss how we can have the player aim in 8 directions and have the arms as well as projectiles position and rotate correctly.

Aiming at Closest Target to Player Preview 13:07

We will discuss how to have the player aim at the closest object to them that contains a tag of 'Target'.

Adding Automatic Firing Capabilities to Weapon Preview 08:19

We will discuss how we can expand the logic in the scriptable object of the projectile to include options that would allow for automatic firing.

Adding More Functionality to Object Pooler Preview 12:30

We will add different pooling types to allow the projectiles to add more to pool if limit is reached, or reset some of the projectiles already on screen to instantiate a new one.

Switching Weapons and Creating Second Projectile Preview 17:31

We will discuss how we can add different weapon types to the weapon script and how we can switch between the different weapons.

Setting Up the Grappling Hook Preview 20:50

We will get started on creating a grappling hook system that will let the projectile connect with certain layers and have the player then rotate around that object and launch off when releasing the weapon fired button.

Finishing the Grappling Hook Preview 25:59

We will finish up everything needed for the grappling hook.

Setting Up Camera Movement Preview 15:22

We will first write out some scripts to lay the foundation for better managing the data outside of the player and then write out code that will setup parameters for the camera so it can smoothly follow the player and present more of what is in front of the player regardless of direction.

Finishing Camera Movement, Fixing a Bug in Dash Script Preview 13:00

We will finish having the camera follow the player through a 'Lerp' method and then discuss a bug that is in the dash script that will force the player back to the position they were in prior to dashing if when they finish the dash there is a platform above preventing them from exiting dash.

Creating Platform Manager Script Preview 10:22

We will start a script that will act as the foundation for all the different types of platforms that have any kind of behavior to them.

Creating a Falling Platform Script and Introduction to Enums Preview 16:44

Using the 'PlatformManager' script we wrote last episode, we will create two different types of falling platforms and discuss how 'enums' work as a data type.

One Way Platforms and On Collision Enter Preview 20:22

We will discuss how we can have the player jump up from the bottom of a platform, fall through if they are standing on top, or do both depending on the enum we chose as the platform.

Creating a Ladder Preview 20:17

We will discuss how we can create a ladder that will let the player go up and down vertically while inside the ladder collider as well as stand on top of it just like a one way platform and then fall through it if you want to go down.

Setting Up Moving Platforms Preview 16:54

We will lay the foundation for moving platforms and code the needed logic for three different types of moving platforms that will follow a path differently depending on which is selected.

Custom Editor Tools for Moving Platforms Preview 14:48

We will discuss how we can setup tools for our 'MovingPlatforms' script that will allow us to create paths much easier and have better control of how the path looks.

Creating Wind and Water Gameobjects with Area Effectors Preview 11:58

We will discuss 'Area Effectors' and how we can extend the 'Rigidbody2D' component to use different types of effectors to achieve different types of physics calculations.

Setting Up Level Bounds and Restricting Camera Movement Preview 14:37

We will setup the camera to restrict its movement so it can only move within the level bounds and not have the viewport show anything outside of the level bounds.

Instantiating the Player into the Scene Preview 12:58

We will discuss how to have the player spawn into the scene at the correct locations rather than have the player placed into the scene through the hierarchy window.

Persisting Character Direction when Instantiating Preview 08:33

We will discuss how we can have the player instantiate into the scene facing the direction they were last in.

Instantiating the Player into the Scene at Multiple Locations Preview 15:53

We will discuss how to have the player correctly instantiate into the scene if there are multiple points of entry.

Creating a Door to Switch Scenes Preview 11:47

We will create a door that will be able to load the next scene when the player crosses the door threshold after shooting it.

Creating a Fade Screen to Load Scenes Preview 14:46

We will create a screen that fades to black when the player loads a scene to have smoother transitions in between loads.

Setting Up the Parameters for Scalable Rooms Preview 06:16

We will discuss how to create levels that can easily be scaled down into a mini map.

Mini Map Camera and Creating Rooms for World Map Preview 11:32

We will discuss how to create multiple cameras in a scene to display different things as well as how we can start to build a world map from the scalable rooms we discussed last episode.

Creating a Player Indicator for Mini Map Preview 08:04

We will create an object that can act as a 'Player Indicator' for the mini map and later the world map

Creating Icons for Mini Map and Setting Up Camera Preview 10:44

We will discuss how we can create other points of interests that can show up on the mini map such as a door or collectible.

Adding Movement to the Player Indicator Preview 11:06

We will discuss how to have the player indicator icon move in the mini map when the player is moving as well.

Mini Map Camera Follow and Clamping Preview 08:56

We will discuss how we can have the mini map camera move within the world map and clamp inside the room that it is supposed to be displaying.

Setting Up the World Map Display Toggle Preview 13:44

We will setup the UI for the big map as well as input to turn the map on when a button is pressed.

Moving and Positioning the Big Map Preview 17:47

We will finish setting everything up for an interactive big map that will pause the game when it's open and allow you to move around the world map to see where else you haven't explored.

Setting Up Fog of War Preview 13:37

We'll take the time to discuss first how a system like this can work and then code everything we would need to have the individual squares for the fog of war to disappear when touched by the player indicator square, but also have that data persist so it remembers which fog of war squares have already been found.

Completing Fog of War Preview 09:03

We'll complete everything for the fog of war system and setup everything within the Unity editor to make sure the script we wrote last episode can accurately hide the world map behind the fog of war squares.

Setting Up Enemy AI and Enemy Movment Preview 14:34

We will lay the foundation for enemy AI and create the parent scripts that will contain popular variables that can be inherited by the children scripts, and setup very basic forward movement.

Turning Enemy Around on Collision and Leftward Movement Preview 07:31

We will solve to make sure the enemy can turn around when they run into certain layers as well as have the enemy not only move leftwards now, but spawn into the scene facing left if you would want them to.

Preventing Enemy from Falling and Turning Around on Holes Preview 15:30

We will discuss raycasts and how we can use them to have the enemy turnaround when there is a gap in the floor in the same way they would turn around if there was a wall in front of them.

Rotating and Moving Enemies Around Platforms Preview 15:23

We will continue exploring raycasts to have the enemy rotate their position so that can walk around the outside perimeter of a platform and cling to the platform as if there is a magnet on the bottom of the enemy keeping it attached to the platform.

Rotating and Moving Enemies Around Platforms Part 2 Preview 10:13

We will get started on coding everything we will need to have the enemy turn around on the inside perimeter of a platform.

Rotating and Moving Enemies Around Platforms Part 3 Preview 07:02

We will finish up this movement type and be able to properly have the enemy rotate around any platform, whether on the outside or inside perimeter.

Solving for Enemy Jumping Preview 10:28

We will create a leap frog style jumping system for the enemy so that after a set amount of time they perform a small jump.

Creating Flying Movement and Player Detector Preview 18:47

We will create a flying movement type to allow the enemy to float as well as setup two different player locator types which will trigger the enemy to follow in the direction of the player if the player is within the detector's range.

Setting Up Everything for Melee Attacks Preview 13:53

We will discuss how to create a melee attack for the enemy including animating the different frames in which the attack would occur as well as hit detection with the player.

Setting Up Everything for Projectile Attacks Preview 19:07

Setting Up Health, Damage, and Player Invulnerability State Preview 14:04

We will go over everything to deal damage with the melee weapon from the enemy and setup an invulnerability time period where the player can't take damage after being hit.

Setting Up Projectile Damage and Random Drops Preview 13:42

We will discuss how we can damage based on the layers certain projectiles pass through and also setup a system that would handle random drops based on percentage drop value when an enemy dies.

Item Pickups and Creating Health Items Preview 11:05

We will turn the prefabs we made last episode into a new type of scriptable object that will act as item pickup, so when the player enters the colliders of these items, the item is consumed and the player receives health based on how much that item gives.

Creating a Player Health Bar Preview 07:24

We will discuss how we can use UI tools to create a health bar that will accurately represent how much heath points the player currently has against the max health points value.

Acquiring Abilities Through Pickups Preview 16:28

We will write out the logic needed to have a pickup activate a movement ability and have that ability persist after picking it up between game plays.

Refining Player Damage and Creating an Out of Bounds System Preview 21:51

We will add some additional parameters that should happen when player receives damage including a knock back force, slow down of time, and also setup a system that warps the player back to an appropriate place based on last place that was safe to stand of a specific place if the out of bounds is setup that way.

Setting Up Player Death Preview 16:06

We will go over everything needed to manage a player death including making a death animation, load the game back to an appropriate spot, and have a game over screen appear.

Setting Up Basic Pause Menu to Navigate UI Screens Preview 19:26

We will setup more robust UI that will offer different options when paused rather than just display the big map.

Setting Up Save/Load System and Title Screen Preview 24:22

We will create a scene that would act as the opening title screen and create the UI that would act as the scene; we will also code out most of the features for the opening scene including the slot system for saving and loading.

Final Episode/Finishing Up Save/Load System Preview 33:04

We will wrap up the entire series with any loose ends we have with the save load system and making sure everything between the different slots has the right data written into them, as well as create a checkpoint prefab that will save the game and player position.

Jump Refinement Preview 16:47

Most of what is discussed in this video is covered when we code out the jump, but I added some logic to better refine the jump and make it less floaty; use this video to supplement what we already wrote for the jump and you should recognize a lot of the code.

Ledge Climbing Preview 18:48

A new feature that allows the player to grab ledges, hang from them, and then climb on top of the ledge or drop off while hanging.

Health Scripts Refactor Using GitHub Solution Preview 05:05

Player Melee Attack Preview 36:17

Changing Characters While Playing Preview 28:35

Solution For Project Preview 00:02