Source/HexchequerGame.m
changeset 6 af9b2b929b03
parent 0 e9f7ba4718e1
child 7 428a194e3e59
     1.1 --- a/Source/HexchequerGame.m	Fri Mar 07 11:43:02 2008 -0800
     1.2 +++ b/Source/HexchequerGame.m	Wed Mar 12 15:51:32 2008 -0700
     1.3 @@ -24,6 +24,7 @@
     1.4  #import "HexGrid.h"
     1.5  #import "Piece.h"
     1.6  #import "QuartzUtils.h"
     1.7 +#import "GGBUtils.h"
     1.8  
     1.9  
    1.10  @implementation HexchequerGame
    1.11 @@ -38,7 +39,7 @@
    1.12      [grid addCellsInHexagon];
    1.13      grid.allowsMoves = YES;
    1.14      grid.allowsCaptures = NO;      // no land-on captures, that is
    1.15 -    grid.cellColor = CGColorCreateGenericGray(1.0, 0.25);
    1.16 +    grid.cellColor = CreateGray(1.0, 0.25);
    1.17      grid.lineColor = kTranslucentLightGrayColor;
    1.18      
    1.19      [self addPieces: @"Green Ball.png" toGrid: grid forPlayer: 0 rows: NSMakeRange(0,2) alternating: NO];
    1.20 @@ -65,12 +66,12 @@
    1.21      int playerIndex = self.currentPlayer.index;
    1.22      BOOL isKing = ([bit valueForKey: @"King"] != nil);
    1.23      
    1.24 -    [[NSSound soundNamed: (isKing ?@"Funk" :@"Tink")] play];
    1.25 +    PlaySound(isKing ?@"Funk" :@"Tink");
    1.26  
    1.27      // "King" a piece that made it to the last row:
    1.28      if( dst.row == (playerIndex ?0 :8) )
    1.29          if( ! isKing ) {
    1.30 -            [[NSSound soundNamed: @"Blow"] play];
    1.31 +            PlaySound(@"Blow");
    1.32              bit.scale = 1.4;
    1.33              [bit setValue: @"King" forKey: @"King"];
    1.34              // don't set isKing flag - piece can't capture again after being kinged.
    1.35 @@ -92,7 +93,7 @@
    1.36          capture = src.r;
    1.37      
    1.38      if( capture ) {
    1.39 -        [[NSSound soundNamed: @"Pop"] play];
    1.40 +        PlaySound(@"Pop");
    1.41          Bit *bit = capture.bit;
    1.42          _numPieces[bit.owner.index]--;
    1.43          [bit destroy];