Chapter 2
Game Programming Basics
This chapter covers the basic elements of programming games and provides a starting point for the chapters that follow. First, you will learn about the basic skeleton of any game, consisting of a game world and a game loop. You will see how to create this skeleton in Swift by looking at various examples such as a simple application that changes the background color. Finally, I will talk about clarifying your code by using comments, layout, and whitespace in the right places.
Building Blocks of a Game
This section talks about the building blocks of a game. I discuss the game world in general and then show you the process of changing it using a game loop, which continuously updates the game world before drawing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access