This course focuses on providing the necessary knowledge and tools to develop mobile games using the Unity game engine and the C# (c-sharp) programming language.
The ultimate and primary goal of the course is to explore the vast majority of functionalities commonly found in mobile games and provide students with a greater understanding of how they operate behind the scenes as well as how to implement them in their own games.
This course focuses on providing the necessary knowledge and tools to develop mobile games using the Unity game engine and the C# (c-sharp) programming language.
The ultimate and primary goal of the course is to explore the vast majority of functionalities commonly found in mobile games and provide students with a greater understanding of how they operate behind the scenes as well as how to implement them in their own games.
The course has been developed in December 2022 and aims to provide the most updated and latest features of Unity. In addition, the contents of the course will be updated weekly to ensure top quality to students.
Lectures cover material in detail and easy-to-understand examples to ensure that all students are able to keep up with the pace of the course and fully comprehend its content. Furthermore, additional resources are provided for each lecture that students can use to review new concepts explored as well as do their own research for a more thorough understanding. Resources provided are in most cases linked to the official documentation of either Unity or C#, or alternatively to trusted and reviewed external resources.
In any case, instructors are active daily and answer questions raised by students within a few hours.
To allow students to fully capture the potential of mobile devices, the course will be going into detail about how to capture different types of user inputs and showing examples of how to fully utilize them in games.
The user inputs covered in this course have been inspired by the most popular mobile games and these include the following:Touches, Swipes, Double taps, Accelerometer inputs (Mainly used for screen shakes), and Gyroscope inputs (Orientation of device in space).
In addition, the course will cover how to implement ways to monetize mobile games and gain revenue through Ads and In-App purchases.
The course focuses on the programming side of game development, exploring different API calls available for us to use, and different types of data structures as well as providing general guidelines to improve the coding experience of students. Each aspect will be discussed and explained to enable students of all backgrounds to keep up with the course.
All of the above will be taught within 3 different projects which will serve as a vehicle for teaching the course.
Two of the projects will be mobile games inspired by popular mobile games, and the last project will be a bonus project covering techniques that weren't applicable in the two games.
The first game will be a runner game, which is one of the most influential genres for mobile gaming and it only seemed appropriate to include a runner game within our course.
The second game will be a tower defense game, which is a genre that has been booming in the past few years in the mobile game development industry, with the genre getting increasingly more popular as the years go by for mobile games.
These two games will allow us to explore a wide variety of functionalities found in mobile games, in Unity, and in C# whilst developing them.
Each game developed provides plenty of room for students to apply their own personal preferences and reflect their style within the games, as well as ways to apply the knowledge gained on their own.
I am a HUGE supporter of learning by doing, so students will be given small assignments which will serve as tiny challenges for students to tackle and practice the knowledge they gained in a real-life scenario. Throughout the development, I provide my opinion on different aspects of game development and how I approach different scenarios to give you a glimpse of how game developers react to different circumstances. The purpose of giving out assignments or challenging you is not to annoy you, but to put the knowledge gained to practice so you are able to get comfortable with the work process of game development, and due to this, none of the assignments are being marked to avoid students getting stressed over them.
A discord server is in place which attempts to unite game developers together and enable students to meet like-minded people to create game development teams, create friendships, and also ask questions and get support for their development journey.
Thank you for your time and I hope to see you in the lectures :)
Welcome, everyone!
This video will be an introduction to the course as we going to have a look at what games will we be making during the course as well as what you will be taught during this course.
Each instructor has their own style and ways of teaching, the same goes for me so I will be explaining to you how I prefer to teach and how lectures will operate throughout the course.
For this lecture, we will do an overview of the game we will be creating, identify the vital components of our game, and prioritize and schedule tasks based on their importance to the game.
This lecture will accomplish various things, including creating the project itself, making a testing scene, and creating a prototype script that will handle our player movement which will be changed/upgraded in the following lectures. Our first implementation of the movement script will be using keyboard-based input to allow us to test our game more easily before adding more complexity.
In order to accommodate mobile input to our existing movement script, we will modify and extend it to track touch inputs on mobile devices, be able to evaluate if a screen touch performs a swipe, and feed our movement function created in the prototype the appropriate input value. By the end of this lecture, our player will be able to move using mobile inputs too.
Without obstacles, there is no game. So after creating the player movement, we will be adding the obstacles that the players will be avoiding in order to not lose. By the end of the lecture, we would have created the actual obstacles and a way to spawn them at the start of our game.
Carrying on with our obstacle creation, during this lecture, we will be creating a way for our obstacles to randomize and regenerate the obstacle's tiles each time they are reset in order to create a more interesting/less repetitive environment.
To finish up our movement script, during this lecture we will complete the following tasks:
- Make the horizontal movement consistent and fix decimal errors.
- Limiting the horizontal movement to the boundaries of our tiles/obstacles.
- Improve the vertical movement to take into account the current velocity of the player.
In addition, I will be showing you an easy trick to make your code to be more readable and less messy at the end of the lecture.
Currently, obstacles seem repetitive and dull. In order to spice things up, we will randomize each tile's color every time an obstacle is reset. Furthermore, we will also be resetting the tile's position to allow different game modes (such as a god mode where players do not lose when colliding with a tile) to be implemented.
Using the default skybox texture provided by Unity is not ideal. During this lecture, we will be discussing what are skyboxes, how they work, and replacing the existing skybox with a more interesting one.
As with all games, our game needs to give players a purpose to keep on playing. To keep players more interested, we will be implementing a scoring system for our game and introduce a way to save the highest score of the player on their system to load it up when starting the game.
We will first achieve this through the "easy" way which is the PlayerPref class but will be replacing it with a more secure way in the following lecture. Why implement this and then replace it straight afterward you may ask?
To provide a more thorough understanding and also give multiple solutions to one problem.
In the previous lecture, we had a look at how we can use the PlayerPrefs class to save data in our game and also discussed the advantages and disadvantages of using the class. During this lecture, we will be replacing the PlayerPrefs implementation of saving the high score of players with a more secure and advanced way using binary files.
User-Interface is a part of every game, including this one.
We will be going through different tools to use when developing a UI/menu for your game to improve the overall result as well as ways to speed up the creation.
During this lecture, we will be covering layout groups, different canvas components, render textures for background videos, and more.
Almost every game includes a text of some form, either that is within its menus, as subtitles for dialogues, or even just to display a title.
Thus, we will be going in-depth into the different properties of the text mesh pro component and its materials to get the most out of the TMP component.
Our game as of now feels uninteresting, so we are going to be changing that during this lecture.
We are going to use and understand Cinemachine cameras to replace our current camera with a more sophisticated implementation.
Furthermore, we are going to be playing around with our player scripts to make our movement seem and feel more interesting.
In addition, we will be going through the solutions for the coding challenge set above, so make sure to complete them before seeing the answers (No Cheating!)
Carrying on with the player experience revamp, we will change the appearance of our player using the Shader Graph to create our own shader and apply it to our player character.
The shader graph is a vast subject, so this lecture will go through the main nodes and components of the shader graph. By the end of the lecture, our player's material will be looking a lot more interesting than our existing material.
In most cases, when you download a new mobile game, you will come across different ads being included to create profit for the developer. For this lecture, we will be exploring ads and how to implement them in our game.
Adding some final touches to our game. This includes:
- Background music randomly being shuffled.
- Post-Processing effects.
- Going through settings
- Building and testing.
For the last lecture of the first part of the course, we will be discussing different ideas that were considered but ended up not making the cut for the course that you could apply to your games.
Discuss what kind of game we will be implementing, lay out the core elements of our game, create a list of tasks to follow, and address different project elements.
To start our game, we will create a map design using the Tile Map component from Unity, and discuss its functionalities and how to use it. By the end of this lecture, we will have a map design in our hands to play with.
Through the power of Artificial Intelligence and the navigation system provided by Unity, we will be implementing a high-quality player movement.
Our implementation will be moving the player to the player's input/touch position using a pathfinding system in place by Unity.
As a first version of our movement script, we are going to be implementing movement that uses mouse inputs, which we will later extend to also track mobile touches.
The course will highlight two ways of creating a navigation system (The default/simple method, and a more advanced/flexible method) and this lecture will cover the first/default method.
We will extend this method in the following lectures as the advanced method provides much more flexibility to our navigation system.
This lecture will focus on extending the movement script to be compatible with mobile input.
In addition, we will be modifying the way our player's destination is set to be more precise than our existing method.
By the end of this lecture, we would have separated the movement script from capturing the input and allocated the input-capturing duties to a different class dedicated to input capture.
Now that we have our basic map and movement, our next task is to create and spawn our towers in the map during run time. This task will be broken down and divided into smaller tasks and each task will have a dedicated lecture to it to avoid very long lectures. The said tasks are the following:
- Spawn the tower (without taking into account where the player is) (This lecture)
- Take into account the player's location and force them to move towards the wanted position that the tower will be spawned prior to spawning the actual tower, as it would be unrealistic to just spawn towers regardless of where the player is. (Next lecture)
- Create a system that allows tower stacking up to a set number (Lecture after that)
Our current tower implementation is unrealistic as our players can spawn towers anywhere regardless of where they are located at.
During this lecture, we will introduce various functionalities that will force the players to move toward the closest hex of the targeted hex prior to spawning the tower.
The functionalities include the following:
- Extending the HexScript to allow hexes to detect their adjacent hexes and store them in their script. (This lecture)
- Using the adjacent hexes stored in their script, when a player attempts to spawn a tower on a hex, the player will be redirected to one of the adjacent hexes of that hex (the closest one to the player). (Next Lecture)
- Once redirected, the player will move towards the adjacent hex and once reached, spawn the tower on the targeted hex. (Next Lecture)
This lecture is split into two parts so it's not too long, so the first part (this video) will focus on setting the adjacent hexes, and the following one will be on how to put the functionality created to good use.
For this lecture, we are going to be working on adding functionality to our hexes and towers to:
A) Exclude the towers when creating a path to move for our agent.
B) Prevent the player from moving to towers and enable hexes to store whether they are occupied from a tower.
This will be the start to build our hex script and tower functionality which will be carried on improving in the following lectures.
Our scene as of now seems simple and boring. Let's change that by conducting an upgrade of the visual aspects of our scene by playing around with the lighting setting of our scene, as well as adding different materials for our hexes depending on if the player is interacting with a hex or not.
Our current tower implementation is unrealistic as our players can spawn towers anywhere regardless of where they are located at.
During this lecture, we will introduce various functionalities that will force the players to move toward the closest hex of the targeted hex prior to spawning the tower.
The functionalities include the following:
- Extending the HexScript to allow hexes to detect their adjacent hexes and store them in their script. (Done in the previous lecture)
- Using the adjacent hexes stored in their script, when a player attempts to spawn a tower on a hex, the player will be redirected to one of the adjacent hexes of that hex (the closest one to the player). (This lecture)
- Once redirected, the player will move towards the adjacent hex and once reached, spawn the tower on the targeted hex. (This lecture)
This lecture is split into two parts so it's not too long, so the first part (previous video) focused on setting the adjacent hexes, and this one will be putting the functionality created to good use.
Our turrets currently have no targets to shoot at and this needs to change.
This lecture will be covering two ways of creating an enemy spawner, the simple way, which spawns and deletes enemies over and over again, and the more advanced way which recycles the enemies instead of wasting them.
This is called pooling and this will be the final version of our game as it's more efficient in terms of performance.
In addition to the above, we are going to explore two data structures in the process of creating our enemy spawner (Dictionaries and Queues) which can be extremely useful in favorable circumstances.
Each data structure has its own use and advantages and this lecture will highlight some of the benefits of using the two data structures using examples.
It's worth mentioning that unity provides a built-in implementation of object pooling but I thought creating a system manually would have been more interesting/useful. Resources for the build-in object pooling method will be provided in the external resources folder
With the enemies and towers in place, we now need to create the tower's shooting system to enable towers to kill the waves of enemies trying to destroy our base.
The approach the course will show is the simplest one which is the turrets shooting at the first turret entering their firing range.
This can be modified in many ways, for example changing it to attack the enemy with the lowest current health, or the strongest/weakest one, etc.
This will be left up to you to decide if you want additional targeting methods for your game and will be a good exercise/challenge to implement them on your own based on what you've learned thus far.
Our game is still missing key elements of its gameplay.
This lecture is dedicated to patching up these missing elements and implementing tiny changes that aren't as important to be included in their own lecture or would be too time-consuming to do.
To summarize, we are going to be implementing the following:
- Addition of 2 new towers
- Implement a shop to purchase towers, as well as the UI for it.
- Implement a UI to select which tower to spawn
- Implement the health system for our base, as well as a visual health bar.
- Implement a non-usable hex, that prevents the player from spawning towers on them and modify existing code to accommodate this addition.
As things stand, players have 3 available towers in their arsenal and I think that's not a very versatile arsenal.
Tower Defence games are all about strategy, coming up with efficient ways to utilize the available resources in the game, and currently, those resources for our game are limited to just towers.
To fix this, we will be implementing bridges that will allow players to create custom shortcuts in levels and enable them to navigate themselves around our levels faster.
Our bridges will be ignored in the navigation system for our players due to the limitations of the navigation system in use. We will be replacing the current method with a more sophisticated one in the following lecture to include our bridges to the navigation system.
A bridge is just an example, and students are encouraged to come up with their own unique ideas to implement in their game and extend the game in a way they see fit.
If you can't come up with ideas, here are some of mine:
- A shop to enable players to purchase turrets from different locations instead of the prefixed ones.
- Walls that will block the enemies and force them to attack and destroy them in order to go through. (This will be easier to do so after watching the next lecture which discusses how to affect navmeshes during run time).
- Potions, such as a freeze potion that will freeze enemies for a short period of time, or a potion to make enemies unable to attack for a short period of time, etc, you get the idea.
- Different types of towers, such as towers that have a very short attacking range and deal huge damage (think in the game Age of War where you have different types of turrets and there is a turret that was a "Bucket" and only attacked enemies that were beneath it, dropping lava on them and dealing huge damage)
I am always available to discuss ideas further in the discord server and guide you if you have any issues.
This lecture will analyze the various tools available to use for creating more complex navigation systems and extend our current (simpler) method with a more advanced method for AI navigation.
Through the advanced method, we divide our level into various Nav Meshes for each agent, including our player and enemies, which will allow us to customize each area for each agent.
Furthermore, we will be implementing runtime modifications to the nav meshes through our code to allow us to include the bridges spawned during runtime to be included in the pathfinding of our player.
Reliability is a crucial aspect of programming that often gets overlooked.
This lecture will focus on creating readable code, with tips and tricks on how to make the most out of the available tools at our disposal.
Nobody wants to play a laggy game, thus we need to ensure that our game is consistent in its performance while running.
To do that, we will go through the different options available in Unity that provides an analysis of the performance of our game and give us an insight into how well or not the game is running, and what changes should be made to improve its stability.
Playtesting is one of the most important parts of game development thus, this lecture is devoted to playtesting our game.
During the lecture, I will express my own personal opinion on the result we have achieved and discuss different things that I like or don't like and how I would carry on with the game if I had more development time available.
In-app purchases are one of the best ways to create extra revenue for a game.
This lecture will focus on setting up in-app purchases for our game with unity and Google Play.
For the final part of this course, we are going to be creating two simple mini-games to demonstrate how to use gyroscopes and accelerometers in games.
I want to congratulate everyone who has reached the end of the course, thank you for participating in our course, and wish you the best of luck with your future plans!
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.