We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f83de2b commit 3d02024Copy full SHA for 3d02024
Assets/Scripts/Board.cs
@@ -39,7 +39,19 @@ public void SpawnPiece()
39
TetrominoData data = this.tetrominoes[random];
40
41
this.activePiece.Initialize(this, this.spawnPosition, data);
42
- Set(this.activePiece);
+
43
+ if (!IsValidPosition(this.activePiece, this.spawnPosition)) {
44
+ GameOver();
45
+ } else {
46
+ Set(this.activePiece);
47
+ }
48
49
50
+ public void GameOver()
51
+ {
52
+ this.tilemap.ClearAllTiles();
53
54
+ // Do anything else you want on game over here..
55
}
56
57
public void Set(Piece piece)
0 commit comments