Back to Browse

Event System and Box2D Physics | Coding a 2D Game Engine in Java #38

3.5K views
Dec 11, 2020
24:36

Join the Discord: https://discord.gg/4tHeAkxNg7 In this episode I go over how to build an event system based on the observer pattern. After that, I talk about how we can create a wrapper around Box2D using our physics components. This consists of copying and sending the data to Box2D so that it can use it within its own engine, then we can tweak the physics components and have that data copied appropriately. Lastly, I go over how to use ImGui to create a context window. This will make it so that when you right-click in the properties window, you are able to add new components to the active game object. Source code: https://github.com/codingminecraft/MarioYoutube/tree/3faeb7032b62a9814e1f3a16994fb9cff8d5a787 Github diff: https://github.com/codingminecraft/MarioYoutube/commit/3faeb7032b62a9814e1f3a16994fb9cff8d5a787?branch=3faeb7032b62a9814e1f3a16994fb9cff8d5a787&diff=split Observer Pattern: https://gameprogrammingpatterns.com/observer.html Box2D Tutorial: https://box2d.org/documentation/md__d_1__git_hub_box2d_docs_hello.html 0:00 Intro 2:12 Discussing the Observer Pattern 4:45 Coding the Event System 8:49 Adding Game Objects to Box2D 20:26 Adding ImGui Code to Add Components --------------------------------------------------------------------- Website: https://ambrosiogabe.github.io/ Github: https://github.com/ambrosiogabe Here are some books I recommend if you want to learn about game engine development more thoroughly. I do not profit off any of these sales, these are just some books that have helped me out :) My Recommended Game Engine Books: Game Engine Architecture: https://www.gameenginebook.com/ Game Physics Cookbook (Read this before the next physics book): https://www.amazon.com/Game-Physics-Cookbook-Gabor-Szauer/dp/1787123669 Game Physics (Ian Millington): https://www.amazon.com/Game-Physics-Engine-Development-Commercial-Grade/dp/0123819768 Game Programming Patterns (Free): https://gameprogrammingpatterns.com/ My Recommended Beginning Game Programming Books: JavaScript Game Design: https://www.apress.com/gp/book/9781430247166 My Recommended Java Books: Data Structures/Algorithms: https://www.amazon.com/Data-Structures-Algorithms-Java-6th-ebook/dp/B00JDRQF8C LWJGL (Free, but I haven't read this thoroughly): https://lwjglgamedev.gitbooks.io/3d-game-development-with-lwjgl/content/

Download

0 formats

No download links available.

Event System and Box2D Physics | Coding a 2D Game Engine in Java #38 | NatokHD