Game Development Reference
In-Depth Information
Figure 3-17 . Timeline of Level1.ccb at the current stage
You can publish, build, and run now to check out the new background. Notice that there's
no parallaxing effect yet, and as you move from left to right the background layers seem
to disappear one by one.
Caution If you notice the game running slowly in the iOS Simulator at this
point, there's no need to worry. The iOS Simulator is terribly slow when it
comes to rendering graphics—it's a software renderer that doesn't use your
Mac's powerful graphics hardware at all! Apple chose to sacrifice performance
in order to have the iOS Simulator's output match exactly what you would see
on a device. If you want to verify performance of an app always test by running
the app on a device.
The same goes for memory usage—the iOS Simulator can take advantages of
all the free memory available on your Mac, so it's very unlikely to run into low
memory situations in the iOS Simulator. On the other hand, iOS devices have at
most 1 GB of RAM, of which only a fraction is available to apps. The earlier
and more often you start testing on an actual device, the better.
While I'm at it, know that the iPhone 4's performance is significantly behind all
other devices, including its iPhone 3GS predecessor. The iPhone 4 has to render
four times as many pixels due to its Retina screen, yet its technical specs clock
it in at just about 33% faster CPU and GPU compared to the iPhone 3GS.
Prepare to Parallax in 3, 2, 1...
To get the background layers to parallax requires some setup steps. The very first thing to
do is introduce a physics node into the equation, and then change the player node to be-
come a child node of the physics node. From then on, the physics node will be the level's
content container rather than the Level1.ccb itself.
Search WWH ::




Custom Search