Skip to content

Commit

Permalink
Hide debug logging by default
Browse files Browse the repository at this point in the history
Signed-off-by: Tomi Leppänen <[email protected]>
  • Loading branch information
Tomin1 committed Sep 22, 2024
1 parent 983af92 commit 396fecb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions qml/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
.import QtQuick.LocalStorage 2.0 as Sql
.import QtQuick 2.6 as QtQuick

var debug = false;

/* Data about the game area */
var blockSize = 18;
var boardWidth = 10;
Expand Down Expand Up @@ -89,7 +91,7 @@ function newPiece() {

if (bagIndex+1 > 6) {
pieceBag.sort(function() { return Math.random() - 0.5; });
console.log("New bag:", pieceBag);
if (debug) console.log("New bag:", pieceBag);
bagIndex = 0;
}

Expand All @@ -111,7 +113,7 @@ function newPiece() {

function startGame() {
blockSize = gameArea.height / boardHeight;
console.log("block:", blockSize);
if (debug) console.log("block:", blockSize);

if (finalPiece) {
finalPiece.destroy();
Expand Down Expand Up @@ -306,7 +308,7 @@ function checkFullRows() {

/* Go thought the array of "rows to be removed" and delete them */
for (var i = 0; i < removeRows.length; i++) {
console.log("Remove row", removeRows[i]);
if (debug) console.log("Remove row", removeRows[i]);
removeRow(removeRows[i]);
}

Expand Down

0 comments on commit 396fecb

Please sign in to comment.