From 3fe1d85eec6b475313f1bbb92e6351fe2b44a39a Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Mon, 16 Mar 2020 08:22:18 +0100 Subject: [PATCH] Fixed start position --- screens/Tetris/GameLogic.js | 2 +- screens/Tetris/Tetromino.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/screens/Tetris/GameLogic.js b/screens/Tetris/GameLogic.js index 44e19a6..80deca8 100644 --- a/screens/Tetris/GameLogic.js +++ b/screens/Tetris/GameLogic.js @@ -27,7 +27,7 @@ export default class GameLogic { this.height = height; this.width = width; this.gameRunning = false; - this.gameTick = 1000; + this.gameTick = 250; this.colors = colors; } diff --git a/screens/Tetris/Tetromino.js b/screens/Tetris/Tetromino.js index 470b97a..5a48fc1 100644 --- a/screens/Tetris/Tetromino.js +++ b/screens/Tetris/Tetromino.js @@ -22,11 +22,6 @@ export default class Tetromino { [0, 1, 0], [1, 1, 1], ], - 20: [ - [1, 0], - [1, 1], - [1, 0], - ], 3: [ [0, 1, 1], [1, 1, 0], @@ -58,6 +53,10 @@ export default class Tetromino { this.currentShape = Tetromino.shapes[type]; this.currentRotation = 0; this.position = {x: 0, y: 0}; + if (this.currentType === Tetromino.types.O) + this.position.x = 4; + else + this.position.x = 3; this.colors = colors; Tetromino.colors = { 0: colors.tetrisI,