diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9940f4a Binary files /dev/null and b/.DS_Store differ diff --git a/Transcendence/srcs/frontend/src/tetris.css b/Transcendence/srcs/frontend/src/tetris.css index 1dd568f..1e88adc 100644 --- a/Transcendence/srcs/frontend/src/tetris.css +++ b/Transcendence/srcs/frontend/src/tetris.css @@ -187,8 +187,8 @@ button:disabled { opacity: 0.3; cursor: not-allowed; } border: 1px solid var(--border); border-radius: 6px; padding: 14px 20px; - margin-top: 0px; /* plus bas */ - margin-left: -800px; /* vers la gauche */ + margin-top: -250px; /* plus bas */ + margin-left: -600px; /* vers la gauche */ box-shadow: 0 0 20px rgba(0,255,231,0.05); position: relative; z-index: 1; diff --git a/Transcendence/srcs/frontend/src/tetris.js b/Transcendence/srcs/frontend/src/tetris.js index 91aabee..428ff93 100644 --- a/Transcendence/srcs/frontend/src/tetris.js +++ b/Transcendence/srcs/frontend/src/tetris.js @@ -47,6 +47,7 @@ class Tetris { this.isPaused = false; this.grid = this._createGrid(10, 20); this.score = 0; + this.count = 0; this.timeToDown = this.initialTimeToDown; this.storedPiece = null; this.canStore = true; @@ -98,7 +99,7 @@ class Tetris { this.lastTime = currentTime; this.accumulator += deltaTime; - while (this.accumulator >= this.timeToDown) { + while (this.isRunning && this.accumulator >= this.timeToDown) { this._tick(); this.accumulator -= this.timeToDown; if (this.accumulator > this.timeToDown * 3) { @@ -268,9 +269,9 @@ class Tetris { } _makeHarder() { - if (this.count >= this.hardening){ + if (this.count >= this.hardening) { this.count = 0; - this.timeToDown -= this.decrementTTD; + this.timeToDown = Math.max(100, this.timeToDown - this.decrementTTD); } }