In 2002 I wrote Mac Game Programming, published by Premier Press. To support the book I created this page, where you can find the latest information, news, and updates.
The book is now out of print, but if you are able to get your hands on a copy, you will see that the book covers the following topics:
I had a request to upload the source code on the book's CD-ROM. Mac Game Programming has been taken off the publisher's site so I'm honoring the request.
I decided to upload only the Mac OS X version of the code. I must warn you. The source code is ancient. I would not recommend using much of it in your own projects, especially anything Mac-specific. You would be much better off using SDL and OpenGL to write a game on Mac OS X today. But you may find the HID Manager, physics, AI, and pathfinding code helpful.
I have modernized some of the code for the book, using OpenGL for graphics, Carbon event loops, nib files, and universal binaries. When I update a chapter's source code, I will place it here. The following items are available to download:
The Project Builder projects on the CD-ROM are missing the file InfoPlist.strings, which the projects require to compile. Add that file to the project or create projects in Xcode and add the source code files and other files to the project.
That is all the program does. If you want to display a different picture, open the resource file Chapter04 Resources in a resource editor like ResEdit and substitute your picture.
Apple added keyboard and mouse support to the HID Manager in Mac OS X 10.2 that broke the code on the CD-ROM. The programs that use the HID Manager (Chapters 8, 10-16) will crash if you don’t have a game controller connected to your machine. The temporary solution is to turn off HID Manager support. You can see how to do this by downloading the Chapter 12 source code in the Downloads section of this page.