Chapter    12

Advanced Input Handling

In this chapter, you will create a more advanced input handling mechanism. At the same time, a few important programming concepts, such as arrays and dictionaries, will be introduced. In the Painter game, input handling was rather basic. You only kept track of the last position that the player touched. For Painter, that was sufficient since the player plays the game using a single finger. In more complex games, this basic method of input handling is not enough. In particular, in Tut’s Tomb, the player may use multiple fingers to drag objects over the screen. In this chapter, you are going to extend the InputHelper class and make it suitable for handling multitouch input.

Creating a Touch Object

The main issue ...

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.