
A game engine is a set of libraries that implements the common functionality that most games will need. It handles things like:
– 2D and 3D graphics rendering to draw stuff on-screen
– Physics and collision detection to move objects realistically
– Audio to play sound effects and music
– User input with keyboards, mice, controllers, or fingers
– Networking to support online multiplayer
– AI for enemy behaviour and pathfinding
Consider the iOS SDK: you don’t need to think about the window server, capacitive touch hardware, runloop events, or hit-testing every time you use the gesture recogniser APIs.
The way a ray of light bounces off a 3D texture doesn’t change much between games. Keyboard and controller inputs are pretty standardised. Physical laws are often the same, barring a few tuning parameters like gravity.
The wheel (or, perhaps “the engine” in this instance) has been invented, we are just shaping the chassis and slapping on some sick decals. We can focus on what makes your game unique. This engine is what I built for you today. Let’s look at how the moving parts are implemented using SwiftUI.
Read the full article here and learn to build 2D games in SwiftUI 🎮
Source by Jacob Bartlett

