Commits

ant512  committed cd6b434

Garbage eggs drop from the top of the screen, not the top of the grid.
Garbage eggs drop faster.
Garbage egg bounce animation is longer and more pronounced.

  • Participants
  • Parent commits e23cd00

Comments (0)

Files changed (7)

File SuperFoulEgg/Engine/Grid.m

 	if (_hasLiveBlocks) return YES;
 
 	// Cannot add live blocks if the grid positions already contain blocks
-	if ([self blockAtX:2 y:0] != nil) return NO;
-	if ([self blockAtX:3 y:0] != nil) return NO;
+	if ([self blockAtX:2 y:GRID_ENTRY_Y] != nil) return NO;
+	if ([self blockAtX:3 y:GRID_ENTRY_Y] != nil) return NO;
 	
 	// Live blocks always appear at the same co-ordinates
-	[self addBlock:block1 x:2 y:0];
-	[self addBlock:block2 x:3 y:0];
+	[self addBlock:block1 x:2 y:GRID_ENTRY_Y];
+	[self addBlock:block2 x:3 y:GRID_ENTRY_Y];
 
 	[block1 startFalling];
 	[block2 startFalling];
 
 			// Find a free block
 			int garbageY = 0;
-			while ([self blockAtX:columns[i] y:garbageY] != nil && garbageY < GRID_HEIGHT) {
+			while ([self blockAtX:columns[i] y:garbageY] != nil && garbageY < GRID_ENTRY_Y) {
 				++garbageY;
 			}
 
 			// If we couldn't find a free block we'll try it in the next column
 			// instead
-			if (garbageY == GRID_HEIGHT) continue;
+			if (garbageY == GRID_ENTRY_Y) continue;
 
 			GarbageBlock* block = [[GarbageBlock alloc] init];
 			[self addBlock:block x:columns[i] y:garbageY];

File SuperFoulEgg/Engine/GridBase.h

 #import "BlockBase.h"
 
 #define GRID_WIDTH 6
-#define GRID_HEIGHT 13
-#define GRID_SIZE 78
+#define GRID_HEIGHT 16
+#define GRID_SIZE 96
+#define GRID_ENTRY_Y 3
 
 /**
  * Maintains the list of blocks that make up the playing grid.

File SuperFoulEgg/Engine/GridBase.m

 
 	int height = 0;
 
-	for (int y = GRID_HEIGHT - 1; y >= 0; --y) {
+	for (int y = GRID_ENTRY_Y - 1; y >= 0; --y) {
 		BlockBase* block = [self blockAtX:index y:y];
 		if (block != nil && block.state == BlockNormalState) {
 			++height;

File SuperFoulEgg/Engine/GridRunner.h

  */
 typedef enum {
 	GridRunnerDropState = 0,					/**< Blocks are dropping automatically. */
-	GridRunnerLiveState = 1,					/**< Live, user-controlled blocks are in play. */
-	GridRunnerLandingState = 2,					/**< Blocks are running their landing animations. */
-	GridRunnerExplodingState = 3,				/**< Blocks are running their exploding animations. */
-	GridRunnerDeadState = 4,					/**< Game is over. */
+	GridRunnerDropGarbageState = 1,				/**< Garbage blocks are dropping. */
+	GridRunnerLiveState = 2,					/**< Live, user-controlled blocks are in play. */
+	GridRunnerLandingState = 3,					/**< Blocks are running their landing animations. */
+	GridRunnerExplodingState = 4,				/**< Blocks are running their exploding animations. */
+	GridRunnerDeadState = 5						/**< Game is over. */
 } GridRunnerState;
 
 /**

File SuperFoulEgg/Engine/GridRunner.m

 	return _nextBlocks[index];
 }
 
+- (void)dropGarbage {
+	
+	// Garbage blocks are dropping down the screen
+	
+	_timer = 0;
+	
+	if (![_grid dropBlocks]) {
+		
+		// Blocks have stopped dropping, so we need to run the landing
+		// animations
+		_state = GridRunnerLandingState;
+	}
+}
+
 - (void)drop {
 
 	// Blocks are dropping down the screen automatically
 		[_grid addGarbage:_incomingGarbageCount];
 
 		// Switch back to the drop state
-		_state = GridRunnerDropState;
+		_state = GridRunnerDropGarbageState;
 
 		_incomingGarbageCount = 0;
 		
 	++_timer;
 
 	switch (_state) {
+		case GridRunnerDropGarbageState:
+			[self dropGarbage];
+			break;
+			
 		case GridRunnerDropState:
 			[self drop];
 			break;
 
 	_incomingGarbageCount += count;
 
-	// TODO: Incoming garbage display needs to be redrawn here
-
 	return YES;
 }
 

File SuperFoulEgg/UI/BlockSpriteConnector.m

 			
 			if (_timer % 2 == 0) {
 				
-				if (_timer < 12) {
+				if (_timer < 16) {
 				
-					static int offsets[6] = { 6, 3, 0, 3, 1, 0 };
+					static int offsets[8] = { 8, 2, -4, 6, -3, 1, -1, 0 };
 					
 					_yOffset = offsets[_timer / 2];
 				} else {

File SuperFoulEgg/UI/GameLayer.h

 #define GRID_Y 0
 #define NEXT_BLOCK_1_X 408
 #define NEXT_BLOCK_2_X 546
-#define NEXT_BLOCK_Y -138
+#define NEXT_BLOCK_Y -280
 #define GRID_2_TAG_X 537
 #define GRID_2_TAG_Y 462
 #define GRID_1_MATCH_SCORE_X 444