Chapter    4

Game Assets

The previous chapters showed you how to make a very basic game application in Swift. You saw how to create a game project in Xcode, and then write a few lines of code to change the background color of an app or to display a text label. You were also introduced to the game loop, and you used the update part of the game loop to vary the background color over time. This chapter will show you how to draw images on the screen, which is the first step toward making nice-looking games. In computer graphics, these images are also called sprites. Sprites are generally loaded from a file. This means any program that draws sprites is no longer simply an isolated set of instructions, but relies on game assets that are stored somewhere. ...

Get Swift Game Programming for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.