
Master building a complete 2D RPG in Unity and C#, from basics to advanced topics like abstract classes, interfaces, and events, with movement, sword and wand attacks, and visual effects.
Learn how to integrate Visual Studio Code, one of the bests code editors, with Unity, so that we can start writing code
Learn how to import the source project into Unity
My most honest advise on how to actually take advantage of this course
Understand what this section will be about and its importance
Learn to create a "game object" and attach a script to be ran
Understand what functions are and how to use them
Variables are also a basic and key concept in C#. In this lecture, we dive into how to use them
Understand when to make your functions and variables public or private
As in real life, if something is true, something happens. In game development it's the same. So, in this lesson we study conditionals applied to programming
If you know shortcuts, you save valuable time. Let's learn them together!
Nice! You're now ready to start creating the game
In this section we'll quickly set up the project so that we can start creating it in the following one
Create your own productive layout in Unity or use the same as I'm
Learn how to import external images in Unity
Similarly to the last lesson, we now import our audio
You did it! The project is now ready to be used to start creating the actual game
Let's start this new section in which we'll move the player
Firstly, we have to add the game object and set it up
Set the Player Input asset to bind the movement action
Start to code the script
We explore the different ways of catching references
In order to start moving our player, we need to set the movement vector based on the input
Understand why we move with the RigidBody instead of with the transform
Understand with a practical example Time.deltaTime
Congratulations on completing the player movement section!
Let's start a new section in which we'll get to add player animations
In order to animate an object, we firstly need to set up the animator
Then, we need to create the different Animation Clips (the actual animations)
Thirdly, we play the corresponding animation depending on the player's direction
Lastly, we flip the SpriteRenderer when needed
Awesome! Now not only can the player move but also animations have been implemented
So, a new section! In this one we won't code a lot. We'll focus on creating the environment
The Tilemap is the type of object that allows you to quickly "paint" your environment. In this lesson we start to create it
It's to paint your own environment using the Tilemap!
The obstacles layer of the Tilemap should have collisions to be detected with other objects. Let's add them
Fix a small Tilemap error
Let's start this new section! It'll be a little bit longer than the previous ones, but we'll take it step by step
As usual, we start off by creating and setting up the game object
We discuss prefabs and their advantages
We introduce another new and key concept: ScriptableObjects, which allow us to easily store data. In this case, enemy data
Fill in the corresponding enemy data in each ScriptableObject
We start using the data stored in the ScriptableObjects to randomly select an enemy sprite
In this lesson we go one step further in our prefabs by taking a look at prefab variants
The enemies will also have weapons, so let's set them up
Using again the EnemyData, we change the weapons SpriteRenderer
The first step to start moving our RigidBody is to get the direction to the player. That's why in this lesson we calculate it with Vector math. Don't worry if you don't understand the concept completely. You can just consider this to just be the "standard formula" to calculate the direction towards an object
We added a stopping distance field to our data but didn’t use it. In this lesson we implement this functionality
Now that the enemy and player are moving, we need to handle collisions correctly to avoid weir behaviors
Awesome! This section has been a little bit longer and more complex. And you still made it trough! Congratulations and see you on the next section whenever you're ready
Let's start a new course section! In this one we'll re-build the movements code to make it cleaner
To start with the refactor, we take a look at the inheritance concept. Don't worry if this one or other concepts in this section seem to be complicated; we'll cover them over and over again lots of times throughout the course. Don't hesitate to send me any questions as well :)
Besides making a variable public or private, we can also make it protected. This is something we'll use a lot in inheritance
Protected can also be used in functions. In this lesson we also cover virtual and override, once again, concepts related to inheritance
The refactor starts! Let's firstly get the rb
In this lesson, we take a look at abstract. This is other concept we'll use a lot when talking about inheritance
Let's start putting the override concept to the practice!
With everything we have learnt, we can start to refactor the enemy stopping distance logic
Quick fix to the enemy movement that looks a little bit laggy
Amazing! This section has been a little bit challenging, right? I'm here to answer any questions you may have. Or you can also consider re-watching this section if needed
In this extra lesson I just wanna make clear why we're refactoring the code rather than directly coding it correctly
Let's start this new section in which we'll create the player base weapon
As usual, we firstly need to set up the object
The base weapon will have some animations. We start to create them in this lesson
After setting up the animations, we need to connect them in the Animator
Now that the animations have been configured, we need to trigger them accordingly
The attack animation should be played when the left mouse button is pressed. In this lesson we add this functionality
We take a look at animation events and their convenience in some specific scenarios. In this case, to determine when the idle animation has started being played
In order to start calculating the target mouse angle, we firstly need to understand the differences between screen and world positions
Using "advanced" math, we calculate the math angle. No need to actually understand the code because you would need to know more complex mathematical concepts. You can think of that code as a premade formula
In this lesson we understand the logic for the weapons flip we'll add
Actually flip the WeaponsContainer to face the mouse direction
Congrats on successfully completely another course section!
Let's start this new section in which we'll add the enemy base weapon
The player and enemy base weapon will share some behavior. But the animations and how they work will be completely different. We it up in this lesson
This script will then allow us to quickly execute a certain logic depending on if the weapon is an enemy or player weapon
We quickly refactor some code of the base weapon to be able to then add more organized logic
We start to implement the basic code of the CharacterSelector
Rapid explanation about why sometimes so many if statements can lead to unproductivity
We introduce the solution to the last problem with Events
Events are invoked in a pretty specific way. In this lesson we learn it
In order to make the events logic better, we store them in a Dictionary
We take the abstract concept we learnt before to improve our code logic
You did it again! Wow! I know this section has been particularly difficult. So, don't hesitate to re-watch it and/or ask me any questions if needed
Step into the world of game development with a hands-on, project-based course where you'll create your very own 2D RPG game using Unity!
In this course, you'll build a fully functional game from scratch that features:
Complete combat system
Different enemies
Smooth player movement
Dual combat mechanics with a close-range knife and long-range potion attacks
Dynamic health system
And much more!
You'll also learn how to bring your game to life with polished visual effects such as potion trails, dynamic lighting, and particle effects that add that special "game juice" everyone loves.
Whether you're a beginner eager to dive in or an intermediate developer looking to enhance your skills, this course provides a clear, step-by-step path to building a complete game project.
What You'll Learn
Unity Fundamentals & Project Setup: Master the Unity interface, scene setup, asset organization, and the basics of 2D game development.
Player & Combat Mechanics: Code fluid player movement and implement a dual-weapon system featuring a short-range knife attack and a long-range potion attack with dynamic visual trails.
UI & Health System Integration: Design and integrate an interactive health bar and other essential UI elements to enhance gameplay.
Enemy Behavior & AI: Develop diverse enemy characters with unique sprites and both melee and ranged attack capabilities.
Polishing Your Game: Incorporate advanced visual effects including dynamic lighting, particle systems, and other enhancements to give your game a professional, polished look.
Enroll now to gain the skills and confidence to create your very own 2D RPG game from start to finish, and take your game development journey to the next level!