Modifying a Single-Player Game

There are a few modifications that we need to make to our single-player game in order to transform it into a multiplayer game.

  • Once we connect to a new peer, we need to begin the game. We also need a way to inform our existing engine that the new game is multiplayer.
  • One device needs to be designated the host device. We will have this one device control the movements of the cows, since both devices can't control cow movement themselves. This is an important step if we want both devices to appear in sync.
  • Each peer needs to inform the other peer(s) about its actions, such as movement and tractor beam usage.
  • Each peer needs to parse the other peer's device and update its own game state to keep both devices in sync ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch 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.