This book is designed to guide you step-by-step through the development of 2D games using Flutter, Flame, and Forge2D. Throughout its chapters, you'll learn the fundamentals of physics applied to video games and how to put them into practice through real-world projects, from small experiments to complete games like DinoJump, Angry Birds, Pinball, and Pong.
The goal is for you to not only understand what each element of the physics engine does, but also how to combine it with the Flutter and Flame architecture to build interactive, fun, and well-organized experiences. I recommend following the chapter order, testing each example, and modifying the code to solidify your understanding of the concepts.
YOU MUST BE FAMILIAR WITH FLUTTER AND FLAME TO TAKE THIS COURSE (I already have a book on Flame; check it out on my profile).
This book has a total of 7 chapters, it is recommended that you read in the order in which they are arranged and as we explain the fundamentals of Forge 2D with Flame based on examples; once you master the library, you can consult the sections in any order you want.
Chapter 1 - Create a project in Flutter and add Flame and Forge 2D: We will create a project in Flutter with the basic dependencies necessary to create games with Forge 2D, Flame and Flutter.
Chapter 2 - Key concepts: We will explain the basic concepts such as what Forge 2D is, bodies, their characteristics and components, applying momentum, speed or forces, body shapes, handling contact between bodies and how to interact with the Forge2D world in general.
Chapter 3 - First experiments: We will create several small examples to present one by one the main characteristics and functionalities of Forge2D, we will see in a practical way the concepts presented in the previous chapter.
Chapter 4 - First game: DinoJump: We will create our first real game in Forge which would be a jumping and horizontal scrolling platform game, we will see how to handle movement, jumping using linear speed in addition to using tile type maps.
Chapter 5 - Second game: Angry Birds: We will create a second game where we will implement functionalities similar to Angry Birds such as positioning a bird, moving the bird in a specific radius using the drag event and adding impulses based on a resulting vector between the origin and final position.
Chapter 6 - Third game: Pinball: We will create a third game where we will implement functionalities similar to Pinball, adding a ball, creating obstacles, creating an arm and implementing a moving goal.
Chapter 7 - Fourth game: Pong: We will create a fourth Pong-style game in which it consists of creating walls, a couple of bars and tilting the bars and walls according to the angle of impact of the ball.