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 5. Beautifying Our Game

In the previous chapter, we learned about cross-device compatibility and what we need to do if we want to target iPhones and iPads simultaneously. We then set up the base for our game. In this chapter, we will begin to add animations to our game.

Working with tweens

Let's say we want to move our ship to an edge of the screen. How would we go about achieving this? The following are two options to achieve this:

  • Move the ship each frame in the direction we want it to move
  • Define two states for our ship and let the processor calculate all the required steps for animation

At first glance, the second option seems to be more attractive. We first need to know the initial position of the ship and the position where the ship ...

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