O'Reilly logo

Learning Objective-C by Developing iPhone Games by Amy M. Booker, Joseph D. Walters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the enemy bombs

Okay. This works well for the player, but the enemies have nothing to do except get hit. Let's give the enemies a little fire power as well. We can pretty much duplicate the same features that we added to the player's bullets, but we will be dropping bombs instead. So wash, rinse, and repeat. Create a new class for the enemy bullet. Under your File menu, add a new file. Choose the file type of Objective-C class as shown in the following screenshot:

Creating the enemy bombs

Name your class EnemyBullet and set the subclass to NSObject as shown in the following screenshot:

Save your file to the default project directory as shown in the following screenshot: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required