A port of Zachtronics' match-4 game HACK*MATCH to the TI-84 Plus CE
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

improved game end screen, fixed minor bug displaying high scores

ariajd27 da790e5b 0a1fc056

+29
+3
CHANGELOG.txt
··· 1 + Version 1.1.0: 2 + - game end screen now flashes "GAME OVER" instead of just displaying it 3 + - displayed high score now updates when the game is restarted
+21
src/drawing.c
··· 14 14 15 15 unsigned char global_palette[32 + sizeof_grid_palette]; 16 16 unsigned char deathStage; 17 + bool deathFlashOn; 18 + unsigned long nextDeathFlash; 17 19 18 20 struct gfx_sprite_t *fileSprites[14]; 19 21 struct gfx_sprite_t *fileMatchSprites[6]; ··· 21 23 struct gfx_sprite_t *deathSprites[3]; 22 24 23 25 gfx_UninitedSprite(behindExa, exa_empty_width, exa_empty_height); 26 + gfx_UninitedSprite(behindGameOver, play_again_width, play_again_height); 24 27 25 28 void drawExa() 26 29 { ··· 218 221 } 219 222 220 223 // ask the player to try again 224 + behindGameOver->width = play_again_width; 225 + behindGameOver->height = play_again_height; 226 + gfx_GetSprite(behindGameOver, PLAY_AGAIN_HOFFSET, PLAY_AGAIN_VOFFSET); 221 227 gfx_RLETSprite_NoClip(play_again, PLAY_AGAIN_HOFFSET, PLAY_AGAIN_VOFFSET); 222 228 gfx_BlitBuffer(); 229 + deathFlashOn = true; 230 + nextDeathFlash = clock() + GAME_OVER_FLASH_TIME; 231 + } 232 + 233 + void deathPeriodic() 234 + { 235 + if (clock() < nextDeathFlash) return; 236 + 237 + if (deathFlashOn) gfx_Sprite_NoClip(behindGameOver, PLAY_AGAIN_HOFFSET, PLAY_AGAIN_VOFFSET); 238 + else gfx_RLETSprite_NoClip(play_again, PLAY_AGAIN_HOFFSET, PLAY_AGAIN_VOFFSET); 239 + 240 + gfx_BlitBuffer(); 241 + 242 + deathFlashOn = !deathFlashOn; 243 + nextDeathFlash = clock() + GAME_OVER_FLASH_TIME; 223 244 }
+1
src/drawing.h
··· 18 18 void drawFrame(); 19 19 bool titleScreen(); 20 20 void animateDeath(); 21 + void deathPeriodic(); 21 22 22 23 #endif
+3
src/main.c
··· 473 473 const unsigned char saveVar = ti_Open(SAVE_VAR_NAME, "w"); 474 474 ti_Write(&score, 3, 1, saveVar); 475 475 ti_Close(saveVar); 476 + highScore = score; 476 477 } 477 478 478 479 if (gameOver) ··· 483 484 // wait for input to either exit or restart 484 485 while (true) 485 486 { 487 + deathPeriodic(); 488 + 486 489 kb_Scan(); 487 490 488 491 if (kb_IsDown(kb_KeyClear)) return false;
+1
src/variables.h
··· 42 42 #define CLEAR_ANIMATION_FRAME_TIME 1600 43 43 #define DEATH_ANIMATION_FRAME_TIME 16000 44 44 #define DEATH_DARKEN_LEVEL 232 45 + #define GAME_OVER_FLASH_TIME 32000 45 46 46 47 #define BG_HOFFSET ((GFX_LCD_WIDTH - background_width) / 2) 47 48 #define BG_VOFFSET ((GFX_LCD_HEIGHT - background_height) / 2)