O'Reilly logo

Sparrow iOS Game Framework Beginner's Guide by Johannes Stein

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 8. Artificial Intelligence and Game Progression

In the previous chapter, we learned about adding user interface elements to our game. We added a hit points representation above our ships, added buttons, and even created our own dialog.

In this chapter, we will add artificial intelligence to our game. The following are the topics we will cover:

  • The concepts of fuzzy logic and state machines
  • Enemy ships should move and attack
  • Adding some kind of progression to the game
  • Winning and losing the game

However, before we get to the actual coding, let's see the concepts of artificial intelligence that we will implement.

Artificial intelligence in theory

The goal for the enemy ships is to move around and attack our ships if they get close enough. There ...

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