Skip to content

Commit

Permalink
Make the block variant to be part of the start information. Also rema…
Browse files Browse the repository at this point in the history
…p so the yellow color is part of the first 5 blocks.
  • Loading branch information
sago007 committed Mar 31, 2024
1 parent 4ce4646 commit b76e007
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/code/BlockGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void BlockGame::NewGame(const BlockGameStartInfo& s) {
recordStats = false;
}
NewGameInternal(s.ticks);
basicBlockVariants = 6;
basicBlockVariants = s.basicBlockVariants;
if (s.timeTrial) {
timetrial = true;
putStartBlocks();
Expand Down
3 changes: 2 additions & 1 deletion source/code/BlockGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ struct BlockGameStartInfo {
int startBlocks = -1;
int handicap = 0;
int gameSpeed = 0;
int basicBlockVariants = 6;
template <class Archive>
void serialize( Archive& ar ) {
ar( CEREAL_NVP(ticks), CEREAL_NVP(timeTrial), CEREAL_NVP(stageClear), CEREAL_NVP(puzzleMode), CEREAL_NVP(singlePuzzle),
CEREAL_NVP(level), CEREAL_NVP(AI), CEREAL_NVP(recordStats), CEREAL_NVP(vsMode), CEREAL_NVP(vsAI),
CEREAL_NVP(startBlocks), CEREAL_NVP(handicap), CEREAL_NVP(gameSpeed) );
CEREAL_NVP(startBlocks), CEREAL_NVP(handicap), CEREAL_NVP(gameSpeed), CEREAL_NVP(basicBlockVariants) );
}
};

Expand Down
8 changes: 4 additions & 4 deletions source/code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ static int InitImages(sago::SagoSpriteHolder& holder) {
globalData.bricks[1] = holder.GetSprite("block_green");
globalData.bricks[2] = holder.GetSprite("block_purple");
globalData.bricks[3] = holder.GetSprite("block_red");
globalData.bricks[4] = holder.GetSprite("block_turkish");
globalData.bricks[5] = holder.GetSprite("block_yellow");
globalData.bricks[4] = holder.GetSprite("block_yellow");
globalData.bricks[5] = holder.GetSprite("block_turkish");
globalData.bricks[6] = holder.GetSprite("block_grey");
globalData.bomb = holder.GetSprite("block_bomb");
globalData.bHighScore = holder.GetSprite("b_highscore");
Expand All @@ -136,8 +136,8 @@ static int InitImages(sago::SagoSpriteHolder& holder) {
globalData.balls[1] = holder.GetSprite("ball_green");
globalData.balls[2] = holder.GetSprite("ball_purple");
globalData.balls[3] = holder.GetSprite("ball_red");
globalData.balls[4] = holder.GetSprite("ball_turkish");
globalData.balls[5] = holder.GetSprite("ball_yellow");
globalData.balls[4] = holder.GetSprite("ball_yellow");
globalData.balls[5] = holder.GetSprite("ball_turkish");
globalData.balls[6] = holder.GetSprite("ball_gray");
globalData.cursor = holder.GetSprite("cursor");
globalData.ready = holder.GetSprite("block_ready");
Expand Down

0 comments on commit b76e007

Please sign in to comment.