Skip to content

Commit 00c094a

Browse files
author
Lionel Laské
committed
Merge branch 'pr/1741' into dev
2 parents c3baee4 + 3378f0f commit 00c094a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4747
- Error loading Etoys activity #1717
4848
- Cheating in Abecedarium Activity #1720
4949
- X and Y axis labels are not Interchanged when switching between Vertical and Horizontal Bar Charts #1727
50+
- BlockRain Activity Game Over Logic Fails When Side Columns Are Full #1739
5051

5152
## [1.8.0] - 2024-04-10
5253
### Added

activities/Blockrain.activity/js/blockrain.jquery.src.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,15 @@
828828
if (game._checkCollisions(x, y+1, blocks, true)) {
829829
drop = false;
830830
var blockIndex = 0;
831+
var gameOver = false;
831832
for (var i=0; i<cur.blocksLen; i+=2) {
832-
game._filled.add(x + blocks[i], y + blocks[i+1], cur.blockType, cur.blockVariation, blockIndex, cur.orientation);
833-
if (y + blocks[i] < 0) {
833+
var blockX = x + blocks[i];
834+
var blockY = y + blocks[i + 1];
835+
// Check if block would be placed at or above the top
836+
if (blockY <= 0) {
834837
gameOver = true;
835838
}
839+
game._filled.add(blockX, blockY, cur.blockType, cur.blockVariation, blockIndex, cur.orientation);
836840
blockIndex++;
837841
}
838842
game._filled.checkForClears();
@@ -845,6 +849,9 @@
845849
this.holding.drop = null;
846850

847851
game.options.onPlaced.call(game.element);
852+
if (gameOver) {
853+
game.gameover();
854+
}
848855
}
849856
}
850857
}

0 commit comments

Comments
 (0)