From 88c364d3bbcc5c3ea78abb7051c161eb87c00bb3 Mon Sep 17 00:00:00 2001 From: Stephen Enders Date: Sat, 12 Feb 2022 12:31:27 -0500 Subject: Create win sequence You can now win the game when you reach a score of 7 This is proxied simply by "does the player have any remaining pieces to play". --- src/helper.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/helper.hpp') diff --git a/src/helper.hpp b/src/helper.hpp index f7d6b8d..e13ee5e 100644 --- a/src/helper.hpp +++ b/src/helper.hpp @@ -34,6 +34,8 @@ static const int ROLL_TILES[2] = { 20, 21 }; static const int PASS_TILES[3] = { 24, 25, 26 }; static const int START_TILES[3] = { 27, 28, 29 }; static const int REROLL_POS[3] = { 3, 7, 13 }; +static const int P1_WIN_TILES[5] = { 30, 31, 32, 33, 34 }; +static const int P2_WIN_TILES[5] = { 35, 36, 37, 38, 39 }; static const char* TITLE = "Royal Game of Ur"; static const sf::Color GLOBAL_MASK(255, 0, 255, 255); @@ -100,6 +102,10 @@ createRollSprites(sf::Texture& t1, sf::Texture& t2); std::shared_ptr> createPassSprites(std::shared_ptr> textures); +std::shared_ptr> +createWinSprites(int player_id, + std::shared_ptr> textures); + std::shared_ptr> createStartSprites(std::shared_ptr> textures); @@ -137,4 +143,7 @@ void clearPiece(std::shared_ptr> pieces, struct piece_t* piece); +bool +hasWon(std::shared_ptr player); + #endif -- cgit v1.2.3-54-g00ecf