Game Development Reference
In-Depth Information
Figure 5-9. Example02Controller_iPhone.xib in Interface Builder
In Figure 5-9 , we see on the left that the root view for this UIViewController has two sub-views.
The first is called Actor view and is the white region in the middle of the gray region on the right. This
is the view where the game will take placeā€”all actors will be represented as UIImageViews that
are sub-views of Actor view. The other component is the UISlider at the bottom of the gray
area. This is used to control the size of the Actor view, allowing us to demonstrate that we have
indeed abstracted the representation of the game from the game itself. The header to the class
Example02Controller will give us an overview of how this is achieved, and is shown in Listing 5-13.
Listing 5-13. Example02Controller.h
#import <UIKit/UIKit.h>
#import <QuartzCore/CADisplayLink.h>
#import "Viper02.h"
#import "Actor02.h"
#import "Asteroid02.h"
@interface Example02Controller : UIViewController {
IBOutlet UIView *actorView;
Search WWH ::




Custom Search