, , , , , .., .
, . , , , ( PLAYING, END_GAME, WAITING_FOR_OTHERPLAYERS) . ONE, , . . , "", , - , . , , " ". , , , ..
, ,
Kenny
: (.. ), . , , ACTUAL, , , , , , , , , , . ! Woo hoo!!
- (void) applicationDidFinishLunching {
gameTimer = [NSTimer scheduledTimerWithTimeInterval:GAMETIME_INTERVAL target:self selector:@selector(myGameLoop) userInfo:nil repeats:TRUE];
}
- (void) startGame {
gameState = PLAYING;
}
NSMutableArray * mTransientObjects;
- (void) fireButtonPressed:(float) atY andTime:(NSTimeInterval) fireTime {
Bullet * aBullet = [[Bullet alloc] initWithY:atY atTime:fireTime];
[mTransientObjects addObject:aBullet];
[aBullet release];
}
- (void) myGameLoop {
switch (gameState) {
case PLAYING:
for (nextObject in mTransientObjects)
[nextObject updateYourself:gameTime];
etc.
}
- (void) updateYourself:(NSTimerInterval) timeInterval {
}