bug fixed
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
@@ -270,7 +271,7 @@ class Tetris {
|
||||
_makeHarder() {
|
||||
if (this.count >= this.hardening) {
|
||||
this.count = 0;
|
||||
this.timeToDown -= this.decrementTTD;
|
||||
this.timeToDown = Math.max(100, this.timeToDown - this.decrementTTD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user