Before we move to the
checkTable
method to tie it all together, we have one more method in the playfield to see. As we have a rule defined as ReplaceBalls
, we need a way to put illegally sunk balls back on the table. This is defined in the plist, so you can set this to your favorite rules. Playing "bar style", this is usually not an option, as coin-operated tables do not allow you to retrieve balls once they are sunk.
Filename: OPPlayfieldLayer.m
-(void)putBallsBackOnTable:(NSMutableArray*)ballArray { // We put the balls we need back on the table, // following racking positions, if the rules specify if ([rules replaceBalls]) { NSMutableArray *deleteArray = [[NSMutableArray alloc] init]; // First we make sure the cue is NOT in the array for (OPBall *aBall in ballArray) { // If it is, we add it to the delete array if (aBall.tag == kBallCue) { [deleteArray addObject:aBall...