Game Development Reference
In-Depth Information
Implementing Game State
The logic presented in Figure 4-7 is implemented in the class CoinsController . To help you
understand how the class CoinsController creates the Coin Sorter game, let's take a look at the
header file. There you can get an overview of the class, shown in Listing 4-7.
Listing 4-7. CoinsController.h
#import<UIKit/UIKit.h>
#import "CoinsGame.h"
@class CoinsController;
<NSObject>
CoinsGame* coinsGame;
UIView* coinsView;
NSMutableArray* imageSequences;
BOOL isFirstCoinSelected;
Coord firstSelectedCoin;
Coord secondSelectedCoin;
BOOL acceptingInput;
UIImageView* coinViewA;
UIImageView* coinViewB;
NSMutableArray* matchingRows;
NSMutableArray* matchingCols;
IBOutlet id<CoinsControllerDelegate>delegate;
}
@property (nonatomic, retain) CoinsGame* coinsGame;
@property (nonatomic, retain) id<CoinsControllerDelegate>delegate;
+(NSArray*)fillImageArray:(int)coin;
-(void)loadImages;
-(void)newGame;
-(void)continueGame:(CoinsGame*)aCoinsGame;
-(void)createAndLayoutImages;
-(void)tapGesture:(UIGestureRecognizer *)gestureRecognizer;
-(Coord)coordFromLocation:(CGPoint) location;
-(void)doSwitch:(Coord)coordA With:(Coord)coordB;
 
Search WWH ::




Custom Search