Have you ever dreamed of creating your own mobile game?
Have you ever wanted to code your own mobile game?
If the answer is YES, then THIS course is for you.
You can learn to code a 2D mobile game from the ground up.
Welcome to the Flame Engine 2D Game Crash Course where you will learn how to design and code a full mobile game in less than 6 hours.
There are so many game enthusiasts who would love to learn how to write mobile games, but do not necessarily have the time to dedicate to it.
Have you ever dreamed of creating your own mobile game?
Have you ever wanted to code your own mobile game?
If the answer is YES, then THIS course is for you.
You can learn to code a 2D mobile game from the ground up.
Welcome to the Flame Engine 2D Game Crash Course where you will learn how to design and code a full mobile game in less than 6 hours.
There are so many game enthusiasts who would love to learn how to write mobile games, but do not necessarily have the time to dedicate to it.
Many Game Engines have a steep learning curve, so creating a full mobile game would take considerable time and effort.
We have created this course for all the coders who want to get into creating their own mobile game using a 2D Game Engine, and more importantly, we have created this course to take you from 0 to hero in less than 6 hours.
We have provided core 6 hours of lectures but, we also provided more than 5 extra hours of Bonus Material including Coding Exercises and extra eplainers.
Why Flame Engine
The Flame Engine is a minimalist 2D game engine that runs on top of the Flutter framework. So it is light-weight with a small footprint.
This is perfect for mobile games.
Advantages of The Flutter Framework
You work with one code base but get multiple platform deployment. Basically write once, and deploy to both iOS and Android. This is a huge advantage as it saves you time and effort.
And this is great for mobile games since we do not rely on the specific OS GUI as we basically take over the screen and create our own GUI from scratch.
Crash Course Format
This is a crash course. So we remove all the fluff from the usual approach and we focus and zone in, with laser precision, on the fundamentals that apply to all 2D engines. We explain the necessary fundamentals such as:
Game Loop
Component Rendering
Spritesheet Animation
Game Mechanics
Inter-Component Communication and Messaging
Component Interoperability and Composability
Collision Detection
Particle Physics
Math for Game developers such as:
Vector Math
Velocity Control
Rotational Control
Collision Detection
Boundary Detection
Game Parallax For Creating Complex Background Motion
Sound Design - For Adding Sounds, Sound Effects, and Music to Your Game.
All The needed API will be explored as well.
Focus on Fundamentals
We will spend the first 3 hours focusing on fundamentals with sample code and architectural examples.
Architectural Approach
Our approach to teaching the material is a bit different from most courses. We take the architectural approach. This means that we will also teach you some Software Engineering while we are teaching you about the Flame Engine.
We will use UML diagrams to show you the context of what we are doing. All of this is to give you a better perspective of how everything fits together.
In other words we will not only work with code. The main objective here is to teach you to think like a Software Architect. We do not want you to just code this game. We want you to go through the process of designing and architecting it in a professional manner.
Using Case Studies
Part of how we teach you in this course revolves around practical case studies. Each case study shows you a full solution to a given element of 2D game coding such as for example Joystick control or collision detection.
The Game we will develop
We will develop, from scratch, using our architectural approach, a game based on the famous retro-game from ATARI: Asteroids.
This is a perfect game for learning all the fundamentals.
Why this particular game
This is a perfect game to learn a 2D game engine for the following reasons:
It has great Game Mechanics such as:
Spaceship Control
Spaceship Explosion
Tracking of Score and Player's Lives
Firing of Bullets
Asteroid Motion/Rotation and Splitting up
Occasional UFO Bonus Showing up
Deterministic Game Level Generation from a JSON File
This will lead us to fully explore and understand:
Joystick Control
Game Loop Update And Render
Timer Component Callbacks
Vector Math
Collision Detection
Particle Physics
Refresh-Rate Independent Rendering
Sounds Design and Game Music
Parallax Effects for Background
This game is also great to be played on both a phone as well as a tablet device.
Assumptions
We assume that you have some coding experience and we also assume that you know Flutter/Dart and have worked with it.
But in case you have not worked with Flutter do not fret.
The course is designed to help you with the setup and a solid understanding of the language elements because of the architectural approach.
So in reality all you need is experience with any Object Oriented language such as Java, Swift, C#, C++, or TypeScript and you will be fine. Practice Makes Perfect
For each Case Study we have provided you with a number of Coding Exercises.
We also provide Solution Videos to explain the solution itself, along with code and some PDF materials as well.
You will learn about what the Flame Engine is and how it fits in with Flutter and Dart.
This is a quick overview of what you will learn in this course.
This course will be taught with an emphasis on understanding the underlying mechanisms of the Flame Engine. We will learn conceptually and use code as a means-to-an-end of learning. We will learn the Architecture of the engine to have a better understanding of its capabilities.
You will learn here which IDE we will be using for this course (Visual Studio in case you are wondering!)
We will test a few concept here from this section.
You will learn about how to set up your coding environment so you can run the code in this course.
This will cover setting up the environment on a Windows machine.
This will cover setting up the environment on a Mac machine.
This will cover setting up the environment on a Linux machine.
In this lecture we learn how to test our Flutter environment to ensure that we can run all the code in the course's examples.
We have attached the test source code that you can use to test your environment as shown in this lecture.
You will learn about the Game Loop concept in Game Engines.
You will learn about the game instantation hierarchy.
You will learn about how your game code is executed in the Flame Engine.
You will learn how to generate a Flutter Project via the command-line which we will use as our shell for the Flame Project in the next lecture.
You will learn how to create your first Flame application. We will add the Flame Engine dependecies to the pubspec.yaml, so that Flame libraries are added to our project, and we will run our first Flame Application!
You will learn how to override the main Game Loop functions, onLoad(), update() and render()
We have also attached the source code that goes with this lecture.
You will learn about the significance of Game Components in Flame, and how they fit into a component tree which is then operated upon by the Game Loop.
We will solidify your understanding of the concepts of Game Engines in this quiz
You will learn how to run the source code that accompanies this course with Visual Studio by importing the sources into a standard Flutter project (which we convert into a Flame project.)
NOTE: The source code used in this lecture is provided here as an attachment for your convenience.
You will learn about what we will cover in this section.
You will learn about the PositionComponent class in Flame Engine which is the parent class for all screen-based objects in Flame games. In other words, if you want to render something on the screen you will need to know about this component.
We will look at a simple demo of the code that we will be writing in the next few lectures.
You will get a quick look at the architecture diagram of a simple code (that we will be writing in this section) which should give you a more of a bird's-eye-view level of the code and its structure within the context of the Flame Engine.
NOTE: The UML Diagram has been provided as a downloadable resource (as an image) for your connvenience.
In this lecture we will start coding the simple 'squares' game that we saw the demo of a few lectures ago.
We also have attached the source code for the full lecture.
You will learn about how Vectors are important to the game math and how different APIs can be used to get useful information such as magnitude, direction, or angle.
We will test some of the key concepts here about components and vectors in Flame Engine.
You will see vectors (i.e. the Vector2 class) in action as we modify our 'squares' code. You will also learn how to remove objects from the component tree.
We also have attached the source code for the full lecture.
You will learn about the very powerful concept of component composability which is the ability to group components together so they can be manipulated as a single object.
We will also look at the design of a health-bar component as an example of compositing multiple objects.
In this lecture we will look at a UML diagram for how to add a life-bar component as a composited component.
NOTE: The UML Diagram has been provided as a downloadable resource (as an image) for your connvenience.
You will look at draft idea code for a life-bar component which showcases component composability by grouping a few rectangular components with the main parent object.
We also have attached the source code for the full lecture.
We will test some of the key concepts here about composability in Flame Engine.
Case Study #1 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise as a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #1 Exercise #1
NOTE: attached you will find the source code for this solution.
Solution to the Case Study #1 Exercises #2 and #3
NOTE: attached you will find the source code for this solution.
Solution to the Case Study #1 Exercise #4
NOTE: Attached you will find the source code for this solution.
NOTE: The UML Diagram has been provided as a downloadable resource (as an image) for your connvenience.
In this case study you will learn how to code a virtual joystick control that the user can utilize to control objects on the screen, which we will use to control a spaceship.
We will look at the UML diagram of how a joystick component and joystick player (i.e. the component that is controlled by the movements of the joystick) are related architecturally in the Flame Engine.
NOTE: The UML Diagram from the lecture has been provided as a downloadable resource (as an image) for your connvenience.
We will look at the joystick code that controls an image of a spaceship on the screen
Note: We have attached the source code for the full lecture.
We will look at how we can generate bullets (i.e. having the spaceship shoot) but with the caveat that we need to set the direction vector for the bullets to match where the spaceship is pointing.
So, if the spaceship is pointing up then the bullets need to shoot up, and if it is pointing at a diagonal then the bullet should shoot in that direction as well. We will need to understand the angle of a vector for that.
We will look at the UML diagram for adding the Bullet into the Joystick and Spaceship mix.
NOTE: The UML Diagram from the lecture has been provided as a downloadable resource (as an image) for your connvenience.
We will look at the addition of Bullets into our code and how we achieve the proper direction vector rotation so that the bullets travel in the right direction.
Note: We have attached the source code for the full lecture.
We will solidify some facts about the Joystick component.
Case Study #2 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise is a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #2 Exercises #1 and #2
NOTE: attached you will find the source code for this solution.
This is an introduction to sound in games and in Flame Engine, Sound effects and music are covered.
We will look at how to add sound assets into our code and then how to play the sounds and music in our game.
Note: We have attached the source code for the full lecture.
We will review and test our knowledge about sounds in Flame Game Engine
Case Study #3 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise is a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #3 Exercises #1 and #2
NOTE: attached you will find the source code for this solution.
We will learn here about collision detection. This is a very important topic for game coding since object interaction is at the heart of most games and especially such shooter game like 'Asteroids'
We will learn how to detect when objects come in contact.
We will learn more about Collision Detection and how we can debug the HitBox shapes so that we can see what the actual collosion area is for a given Object.
We will look at the Architectural Diagram for our collision detection code sample. You will be able to see the different elements that are needed to make an application use Collision Detection.
We will look at Collision Detection in action by having a number of moving balls on the screen that change color when they collide with each other.
Note: We have attached the source code for the full lecture.
We will test a deeper understanding of the Collision Detection workflow in this quiz.
Case Study #4 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise is a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #4 Exercise #1
NOTE: attached you will find the source code for this solution.
Solution to the Case Study #4 Exercise #2
NOTE: attached you will find the source code for this solution.
You will learn how to use Timers to control repetitive tasks and interval-based notifications.
We will test you knowlegde of Timers in Flame
We will look at how to code an interval and countdown times. Here we will use Timer utility classes. In the next lecture we will look at Timer components.
Note: We have attached the source code for the full lecture.
In this lecture we will see how to do the same timer-based coding but with an Object Oriented TimerComponent class.
Note: We have attached the source code for the full lecture.
Some more questions for Timers
Case Study #5 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise is a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #5 Exercise #1
NOTE: attached you will find the source code for this solution.
Solution to the Case Study #5 Exercise #2
NOTE: attached you will find the source code for this solution.
In this lecture we will study the Parallax Effect and how to create it in games.
In this lecture we will see how to code a horizontal parallax effect with 5 images. You will learn about the base multiplier to control the relative parallax speed as well as how to code for landscape device orientation.
Note: We have attached the source code for the full lecture.
We will code a slight parallax variation: a vertical 2-image parallax to simulate a starry sky.
Note: We have attached the source code for the full lecture.
Case Study #6 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise is a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #6 Exercises #1 and #2
NOTE: attached you will find the source code for this solution.
Solution to the Case Study #6 Exercise #3
NOTE: attached you will find the source code for this solution.
Exciting times! We are going to learn about the particle system in the Flame Engine which will allow us to work with particle generators and some cool particle physics. In this lecture we introduce the whole Particle System in Flame.
We will test here the understanding of some basic particle concepts in the Flame Engine.
Another question to test your understanding.
We will look at the code for Particle Stream simulation and understand how the Particle Generator builds up a particle system.
Note: We have attached the source code for the full lecture.
We will look at the code for how to generate what looks like an explosion using the particle system.
Note: We have attached the source code for the full lecture.
We will look at the code for how to generate what looks like an explosion using the particle system, as we have learned in the previous lecture.
Note: We have attached the source code for the full lecture.
We are going to look at a more complex and ambitious particle simulation: that of fireworks. We will try to capture the fireworks mechanics.
We are going to look at a more complex and ambitious particle simulation: that of fireworks. We will try to capture the fireworks mechanics.
We will look at the code for how to generate what looks like fireworks using the particle system, as we have learned in the previous lecture.
Note: We have attached the source code for the full lecture.
Even more Particle Systems related Questions
The last example of a particle simulation will be a photo-realistic (animation based) explosion using a SpriteSheet component.
Note: We have attached the source code for the full lecture.
Case Study #7 Exercises
These are coding exercises that you should attempt to do. They will allow you to review the concepts of this case study and learn to use the Flame Engine's APIs.
You will find two resources here as well:
A PDF file with solution discussion. You can view this before you look at the source code.
The source code for this exercise is a .ZIP file. Once you unzip the file you will find all the sources as discussed in Lecture #18. Please follow that lecture for HOW TO run this code.
Solutions
Actual code solutions are provided in the remaining lectures in this section.
Solution to the Case Study #7 Exercise #1
NOTE: attached you will find the source code for this solution.
Solution to the Case Study #7 Exercise #2 - Segment #1
NOTE: attached you will find the source code for this solution. Please also note that this source has all the segments from exercise#2. We have split the explanation into 8 segments (so 8 videos) but the source code is in one application, which is attached to this lecture.
Solution to the Case Study #7 Exercise #2 - Segment #2
NOTE: attached you will find the source code for this solution.
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.