O'Reilly logo

Game Development with Swift by Stephen Haney

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

Chapter 5. Spawning Enemies, Coins, and Power-ups

One of the most enjoyable and creative aspects of game development is building the game world for your players to explore. Our young project is starting to resemble a playable game after adding the controls; the next step is to build more content. We will create additional classes for new enemies, collectible coins, and special power-ups that give Pierre Penguin a boost as he navigates the perils of our world. We can then develop a system to spawn increasingly difficult patterns of these game objects as the player advances.

The topics in this chapter include:

  • Adding the power-up star
  • A new enemy – the mad fly
  • Another terror – bats!
  • The spooky ghost
  • Guarding the ground with the blade
  • Adding coins
  • Testing ...

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