Testing our contact code

Now that you can see your console output, run the project. You should see our print strings appear in the console as you fly Pierre into various game objects. Your console should look something like this:

Testing our contact code

Congratulations— if you see the contact output in the console, you have completed the structure for our contact system.

You may notice that flying into coins produces strange collision behavior, which we will enhance later in this chapter. Next, we will add game logic for each type of contact.

Note

Checkpoint 7-A

The code up to this point is available in this chapter's code resources.

Get Swift Game Development - Third Edition 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.