diff --git a/assets/tiles/tiles.png b/assets/tiles/tiles.png index 0f58f44..602d72d 100644 Binary files a/assets/tiles/tiles.png and b/assets/tiles/tiles.png differ diff --git a/assets/tiles/tiles.pyxel b/assets/tiles/tiles.pyxel index dcb8b75..42c15d4 100644 Binary files a/assets/tiles/tiles.pyxel and b/assets/tiles/tiles.pyxel differ diff --git a/src/game.c b/src/game.c index 9cd171d..d47b029 100644 --- a/src/game.c +++ b/src/game.c @@ -629,8 +629,10 @@ void end_game_state(uint8_t black, uint8_t white) { // display winner if(black > white) { write_string("PLAYER 1 WINS!", 14, 0); + set_background(stone_color1 + 0x10); } else if(white > black) { write_string("PLAYER 2 WINS!", 14, 0); + set_background(stone_color2 + 0x10); } else { write_string("IT'S A TIE!", 14, 0); } diff --git a/src/video.c b/src/video.c index 6fe05a0..d8c5f36 100644 --- a/src/video.c +++ b/src/video.c @@ -57,6 +57,19 @@ void init_screen() { * */ void clear_screen() { + // set background + set_background(TILE_BG); + + // set all foreground tiles to transparent + clear_foreground(); +} + +/** + * @brief Which tile to use for the background + * + * @param tile_id background tile index + */ +void set_background(uint8_t tile_id) { uint8_t i = 0, j=0; uint32_t map_base_addr; @@ -68,13 +81,10 @@ void clear_screen() { for (j=0; j