diff --git a/$1 b/$1 new file mode 100644 index 0000000..22b914d --- /dev/null +++ b/$1 @@ -0,0 +1,2 @@ + +C:\Users\Architect\Desktop\Dev\Tetrion>python3 -m http.server diff --git a/1 b/1 new file mode 100644 index 0000000..22b914d --- /dev/null +++ b/1 @@ -0,0 +1,2 @@ + +C:\Users\Architect\Desktop\Dev\Tetrion>python3 -m http.server diff --git a/dist/tetrion.js b/dist/tetrion.js index 97608ab..19f3ffd 100644 --- a/dist/tetrion.js +++ b/dist/tetrion.js @@ -268,7 +268,7 @@ var colors = ['#ef7a21','#f7d308','#ef2029','#ad4d9c','#5a658f','#42b642','#31c7 // Gamestates -var gameStates = ["freePlayState", "trainerState", "testTrainerStates", "sequenceEditorState"]; +var gameStates = ["freePlayState", "trainerState", "testTrainerStates", "sequenceEditorState", "quizState"]; var defaultGameState = "freePlayState"; //sidebar width @@ -671,7 +671,7 @@ var UserInputs = { settingsDefault: [ "167.0", "33.0", "37", "39", "40", "38", - "32", "16", "90", "88", "17", "82", "81", + "32", "16", "90", "88", "17", "82", "80", "167.0", "33.0", "DPad-Left", "DPad-Right", "DPad-Down", @@ -845,6 +845,7 @@ Tetris.prototype = { // if true no openers. just random tetrinos this.gameState = consts.DEFAULT_GAMESTATE; + this.isPaused = false; this.isTimerOn = false; this.currentOpener = 0; this.matrix = initMatrix(consts.ROW_COUNT, consts.COLUMN_COUNT); @@ -1002,6 +1003,7 @@ Tetris.prototype = { }, //Reset game reset: function() { + this.pause = false; this.numlefts = 0; this.running = false; this.isGameOver = false; @@ -1047,11 +1049,11 @@ Tetris.prototype = { }, //Pause game - pause: function() { + /*pause: function() { this.running = false; this.currentTime = new Date().getTime(); this.prevTime = this.currentTime; - }, + },*/ pushHoldStack: function() { if(this.gameState == consts.GAMESTATES[3]) { @@ -1189,22 +1191,24 @@ Tetris.prototype = { this.manipulationCounter = 0; this._draw(); + }, _recurseGameState: function (){ switch(this.gameState) { - case consts.GAMESTATES[0]: + case consts.GAMESTATES[0]: // Free play this._processFreeplayQueue(); this._fireShape(); break; - case consts.GAMESTATES[1]: + case consts.GAMESTATES[1]: // Trainer + this._processOpenerTrainerQueue(); + this._fireShape(); + break; + + case consts.GAMESTATES[2]: // Test this._processOpenerTrainerQueue(); this._fireShape(); - break; - case consts.GAMESTATES[2]: - this._processOpenerTrainerQueue(); - this._fireShape(); - case consts.GAMESTATES[3]: + case consts.GAMESTATES[3]: // Sequence Test this._processSequenceEditor(); break; @@ -1215,8 +1219,10 @@ Tetris.prototype = { // lockdown timer with centisecond resolution resetLockdown: function() { - if(this.shape.canDown(this.matrix) == false) + if(this.shape.canDown(this.matrix) == false) { this.landed = true; + this.manipulationCounter = 0; + } this.lockDownTimer = 0; @@ -1233,11 +1239,13 @@ Tetris.prototype = { }, // Draw game data _draw: function() { + if(this.isPaused) + return; canvas.drawScene(); canvas.drawShape(this.shape); canvas.drawHoldShape(this.holdStack); canvas.drawPreviewShape(this.shapeQueue); - if(this.gameState != consts.GAMESTATES[2]) + if(this.gameState != consts.GAMESTATES[2]) // || this.gameState != consts.GAMESTATES[4] quiz mode canvas.drawHintShape(this.hintMino); if(this.shape != undefined) { @@ -1387,6 +1395,12 @@ Tetris.prototype = { else document.getElementById("divbg").style.display="none"; } + + else if(inputs.settingsMap.get("Keyboard Background").includes(curkey)) { + //setInterval(() => { this.isPaused = !this.isPaused; }, 300) ; + this.isPaused = !this.isPaused; + } + if(inputs.settingsMap.get("Keyboard Reset").includes(curkey)) { this._restartHandler(); return; @@ -1433,7 +1447,8 @@ Tetris.prototype = { }, // Update game data _update: function() { - + if(this.isPaused) + return; switch(this.gameState) { case consts.GAMESTATES[0]: case consts.GAMESTATES[1]: @@ -1572,196 +1587,70 @@ var openerGenerator = { case 1: // Fonzie Variation this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3)); break; case 2: // DTCannon this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3), shapes.getShape(1), shapes.getShape(3)); break; case 3: this.shapeQueue = new Array( - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(1), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3)); break; case 4: //Pokemino's STD this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3), shapes.getShape(0), shapes.getShape(3)); break; case 5: // Mr TSpins STD reversed this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); break; case 6: // Hachispin this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(0), shapes.getShape(3)); break; case 7: // Albatross - this.shapeQueue = new Array(shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); + this.shapeQueue = new Array( + shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); break; case 8: // Number One this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3)); break; case 9: // Pelican this.shapeQueue = new Array( - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3)); break; case 10: // DT Cannon TSZ base this.shapeQueue = new Array( - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); break; case 11: this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(1), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(3), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6)); break; case 12: this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3)); break; case 13: - this.shapeQueue = new Array(shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); + this.shapeQueue = new Array( + shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); break; case 14: - this.shapeQueue = new Array(shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); + this.shapeQueue = new Array( + shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); break; case 15: - this.shapeQueue = new Array(shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); + this.shapeQueue = new Array( + shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); break; @@ -1809,13 +1698,7 @@ var openerGenerator = { case 1: // Fonzie Variation this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3)); // position x, position y, orientation, position x,... var hintDataList = [-1,17,1, 3,18,0, 6,18,0, 5,17,1, 3,17,0, 7,16,0, 1,17,2]; @@ -1826,20 +1709,7 @@ var openerGenerator = { case 2: // DT Cannon this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3), shapes.getShape(1), shapes.getShape(3)); // position x, position y, orientation, position x,... var hintDataList = [-2,18,0, 4,16,1, 6,17,1, 7,17,1, 4,17,-1, 3,17,3, 3,15,0, 5,15,0, 7,14,1, 2,13,-1, -1,15,1, 1,16,2, 3,16,1, 1,17,-1]; @@ -1853,20 +1723,7 @@ var openerGenerator = { case 3: //MKO Stacking this.hintQueue = new Array( - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(1), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3)); // position x, position y, orientation, position x,... var hintDataList = [0,18,0, 0,16,-1, 8,16,-1, 4,18,0, 4,16,1, 5,18,0, 1,15,-1, 2,17,2, 5,18,0, 3,17,1, 6,16,0, 0,15,2, 0,14,0, 2,16,2]; @@ -1880,23 +1737,7 @@ var openerGenerator = { case 4: //Pokemino's STD this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3), shapes.getShape(0), shapes.getShape(3)); var hintDataList = [0,17,1, -2,16,1, 4,18,0, 4,17,-1, 3,15,1, 8,17,-1, 2,17,2, 0,17,0, 0,15,-1, 1,15,0, 8,16,-2, 5,15,-1, 3,14,1, 6,12,-1, 6,16,1, 2,16,-1, 7,17,2 ]; @@ -1910,22 +1751,7 @@ var openerGenerator = { case 5: // Mr TSpins STD reversed this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); var hintDataList = [4,18,0, 0,18,0, 7,17,1, 0,15,1, 4,17,-1, 5,14,-1, 2,17,2, 1,17,0, -1,16,-1, 2,15,-1, 0,14,0, 3,15,1, 8,16,-1, 5,13,2, 6,16,1, 7,17,2 ]; @@ -1940,20 +1766,7 @@ var openerGenerator = { case 6: // Hachispin this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(0), shapes.getShape(3)); var hintDataList = [1,18,0, 0,18,0, 8,16,-1, 2,15,1, 6,17,2, 5,16,2, 1,16,2, -1,16,-1, -1,16,0, 5,16,0, 0,14,0, 3,15,0, 8,14,-1, 7,16,-1]; @@ -1964,7 +1777,8 @@ var openerGenerator = { } break; case 7: // Albatross - this.hintQueue = new Array(shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); + this.hintQueue = new Array( + shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); var hintDataList = [1,18,0,0,17,3,8,16,3,5,17,2,6,16,2,3,16,0,1,16,2,-1,17,1,5,17,3,5,18,0,6,16,0,2,15,3,3,15,1,1,17,3]; this.createHintQueue(hintDataList); @@ -1972,13 +1786,7 @@ var openerGenerator = { case 8: // Number One this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3)); var hintDataList = [3,18,0, 0,17,2, 0,16,0, 4,15,-1, 6,17,0, 8,16,-1, 3,17,-1]; @@ -1991,13 +1799,7 @@ var openerGenerator = { case 9: // Pelican this.hintQueue = new Array( - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3)); var hintDataList = [0,17,-1, 1,16,2, 5,18,0, 5,16,-1, 8,16,-1, 5,17,0, 3,16,2]; @@ -2010,17 +1812,7 @@ var openerGenerator = { case 10: // O - 1, I - 6, L - 0, S - 5, J - 4, Z - 2, T - 3 // DT Cannon TSZ base this.hintQueue = new Array( - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); var hintDataList = [4,18,0, -2,18,0, 2,17,1, 8,16,-1, 6,17,-1, 7,17,-1, 3,15,2, -1,15,1, 2,13,-1, 1,16,2, 1,17,3]; @@ -2032,64 +1824,37 @@ var openerGenerator = { break; case 11: this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(1), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(3), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6)); var hintDataList = [3,17,1,6,18,0,1,17,3,5,17,3,2,16,3,-1,17,1,4,15,0,5,13,1,3,14,0,-1,14,3,8,15,3,-1,15,0,0,13,0,6,16,2,0,13,2,4,14,0,2,13,3,6,17,1,7,18,0,3,16,1,7,17,2,6,18,0,1,18,0,-1,17,1,2,16,2,5,17,0,0,15,2,3,15,2,6,15,2,8,16,3]; this.createHintQueue(hintDataList); break case 12: this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3)); var hintDataList = [3,17,1,6,18,0,5,17,2,1,18,0]; this.createHintQueue(hintDataList); break; case 13: - this.hintQueue = new Array(shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); + this.hintQueue = new Array( + shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); var hintDataList = [0,18,0,3,18,0,-1,17,0,7,18,0,3,17,0,8,16,3,0,15,2,-2,14,0,3,15,2,3,14,0,1,13,3,8,14,3,7,12,2,5,16,2,3,14,3,6,17,3,5,18,0]; this.createHintQueue(hintDataList); break; case 14: - this.hintQueue = new Array(shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); + this.hintQueue = new Array( + shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); var hintDataList = [-1,17,1,3,18,0,3,17,0,7,18,0,6,16,3,8,16,3,0,16,3,0,14,0,8,13,3,4,15,1,6,14,2,1,17,1,2,17,2]; + this.createHintQueue(hintDataList); break; case 15: - this.hintQueue = new Array(shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); + this.hintQueue = new Array( + shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); var hintDataList = [-1,17,1,2,18,0,4,17,3,6,18,0,6,17,0,2,15,2,-1,14,1,5,17,0,4,14,3,5,14,3,6,15,0,6,14,3,8,12,3,0,16,1,6,15,0,0,15,0,-1,12,3,6,13,1,2,15,0,3,13,0,1,17,2,5,14,1,6,15,0,2,17,3,3,15,2,1,17,2]; + this.createHintQueue(hintDataList); break; default: diff --git a/index.html b/index.html index d6a458e..377f1d8 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,11 @@ + + + + + + diff --git a/src/consts.js b/src/consts.js index bfe4459..da247ff 100644 --- a/src/consts.js +++ b/src/consts.js @@ -6,7 +6,7 @@ var colors = ['#ef7a21','#f7d308','#ef2029','#ad4d9c','#5a658f','#42b642','#31c7 // Gamestates -var gameStates = ["freePlayState", "trainerState", "testTrainerStates", "sequenceEditorState"]; +var gameStates = ["freePlayState", "trainerState", "testTrainerStates", "sequenceEditorState", "quizState"]; var defaultGameState = "freePlayState"; //sidebar width diff --git a/src/input.js b/src/input.js index a85ce3f..4388c90 100644 --- a/src/input.js +++ b/src/input.js @@ -238,7 +238,7 @@ var UserInputs = { settingsDefault: [ "167.0", "33.0", "37", "39", "40", "38", - "32", "16", "90", "88", "17", "82", "81", + "32", "16", "90", "88", "17", "82", "80", "167.0", "33.0", "DPad-Left", "DPad-Right", "DPad-Down", diff --git a/src/main.js b/src/main.js index 30d735b..abee6b8 100644 --- a/src/main.js +++ b/src/main.js @@ -161,6 +161,7 @@ Tetris.prototype = { // if true no openers. just random tetrinos this.gameState = consts.DEFAULT_GAMESTATE; + this.isPaused = false; this.isTimerOn = false; this.currentOpener = 0; this.matrix = initMatrix(consts.ROW_COUNT, consts.COLUMN_COUNT); @@ -318,6 +319,7 @@ Tetris.prototype = { }, //Reset game reset: function() { + this.pause = false; this.numlefts = 0; this.running = false; this.isGameOver = false; @@ -363,11 +365,11 @@ Tetris.prototype = { }, //Pause game - pause: function() { + /*pause: function() { this.running = false; this.currentTime = new Date().getTime(); this.prevTime = this.currentTime; - }, + },*/ pushHoldStack: function() { if(this.gameState == consts.GAMESTATES[3]) { @@ -505,22 +507,24 @@ Tetris.prototype = { this.manipulationCounter = 0; this._draw(); + }, _recurseGameState: function (){ switch(this.gameState) { - case consts.GAMESTATES[0]: + case consts.GAMESTATES[0]: // Free play this._processFreeplayQueue(); this._fireShape(); break; - case consts.GAMESTATES[1]: + case consts.GAMESTATES[1]: // Trainer + this._processOpenerTrainerQueue(); + this._fireShape(); + break; + + case consts.GAMESTATES[2]: // Test this._processOpenerTrainerQueue(); this._fireShape(); - break; - case consts.GAMESTATES[2]: - this._processOpenerTrainerQueue(); - this._fireShape(); - case consts.GAMESTATES[3]: + case consts.GAMESTATES[3]: // Sequence Test this._processSequenceEditor(); break; @@ -531,8 +535,10 @@ Tetris.prototype = { // lockdown timer with centisecond resolution resetLockdown: function() { - if(this.shape.canDown(this.matrix) == false) + if(this.shape.canDown(this.matrix) == false) { this.landed = true; + this.manipulationCounter = 0; + } this.lockDownTimer = 0; @@ -549,11 +555,13 @@ Tetris.prototype = { }, // Draw game data _draw: function() { + if(this.isPaused) + return; canvas.drawScene(); canvas.drawShape(this.shape); canvas.drawHoldShape(this.holdStack); canvas.drawPreviewShape(this.shapeQueue); - if(this.gameState != consts.GAMESTATES[2]) + if(this.gameState != consts.GAMESTATES[2]) // || this.gameState != consts.GAMESTATES[4] quiz mode canvas.drawHintShape(this.hintMino); if(this.shape != undefined) { @@ -703,6 +711,12 @@ Tetris.prototype = { else document.getElementById("divbg").style.display="none"; } + + else if(inputs.settingsMap.get("Keyboard Background").includes(curkey)) { + //setInterval(() => { this.isPaused = !this.isPaused; }, 300) ; + this.isPaused = !this.isPaused; + } + if(inputs.settingsMap.get("Keyboard Reset").includes(curkey)) { this._restartHandler(); return; @@ -749,7 +763,8 @@ Tetris.prototype = { }, // Update game data _update: function() { - + if(this.isPaused) + return; switch(this.gameState) { case consts.GAMESTATES[0]: case consts.GAMESTATES[1]: diff --git a/src/openers.js b/src/openers.js index 683d3af..29ec469 100644 --- a/src/openers.js +++ b/src/openers.js @@ -22,196 +22,70 @@ var openerGenerator = { case 1: // Fonzie Variation this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3)); break; case 2: // DTCannon this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3), shapes.getShape(1), shapes.getShape(3)); break; case 3: this.shapeQueue = new Array( - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(1), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3)); break; case 4: //Pokemino's STD this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3), shapes.getShape(0), shapes.getShape(3)); break; case 5: // Mr TSpins STD reversed this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); break; case 6: // Hachispin this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(0), shapes.getShape(3)); break; case 7: // Albatross - this.shapeQueue = new Array(shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); + this.shapeQueue = new Array( + shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); break; case 8: // Number One this.shapeQueue = new Array( - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3)); break; case 9: // Pelican this.shapeQueue = new Array( - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3)); break; case 10: // DT Cannon TSZ base this.shapeQueue = new Array( - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); break; case 11: this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(1), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(3), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6)); break; case 12: this.shapeQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3)); break; case 13: - this.shapeQueue = new Array(shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); + this.shapeQueue = new Array( + shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); break; case 14: - this.shapeQueue = new Array(shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); + this.shapeQueue = new Array( + shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); break; case 15: - this.shapeQueue = new Array(shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); + this.shapeQueue = new Array( + shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); break; @@ -259,13 +133,7 @@ var openerGenerator = { case 1: // Fonzie Variation this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3)); // position x, position y, orientation, position x,... var hintDataList = [-1,17,1, 3,18,0, 6,18,0, 5,17,1, 3,17,0, 7,16,0, 1,17,2]; @@ -276,20 +144,7 @@ var openerGenerator = { case 2: // DT Cannon this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3), shapes.getShape(1), shapes.getShape(3)); // position x, position y, orientation, position x,... var hintDataList = [-2,18,0, 4,16,1, 6,17,1, 7,17,1, 4,17,-1, 3,17,3, 3,15,0, 5,15,0, 7,14,1, 2,13,-1, -1,15,1, 1,16,2, 3,16,1, 1,17,-1]; @@ -303,20 +158,7 @@ var openerGenerator = { case 3: //MKO Stacking this.hintQueue = new Array( - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(3)); + shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(1), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(3)); // position x, position y, orientation, position x,... var hintDataList = [0,18,0, 0,16,-1, 8,16,-1, 4,18,0, 4,16,1, 5,18,0, 1,15,-1, 2,17,2, 5,18,0, 3,17,1, 6,16,0, 0,15,2, 0,14,0, 2,16,2]; @@ -330,23 +172,7 @@ var openerGenerator = { case 4: //Pokemino's STD this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3), shapes.getShape(1), shapes.getShape(5), shapes.getShape(2), shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(3), shapes.getShape(0), shapes.getShape(3)); var hintDataList = [0,17,1, -2,16,1, 4,18,0, 4,17,-1, 3,15,1, 8,17,-1, 2,17,2, 0,17,0, 0,15,-1, 1,15,0, 8,16,-2, 5,15,-1, 3,14,1, 6,12,-1, 6,16,1, 2,16,-1, 7,17,2 ]; @@ -360,22 +186,7 @@ var openerGenerator = { case 5: // Mr TSpins STD reversed this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(3), shapes.getShape(1), shapes.getShape(6), shapes.getShape(2), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); var hintDataList = [4,18,0, 0,18,0, 7,17,1, 0,15,1, 4,17,-1, 5,14,-1, 2,17,2, 1,17,0, -1,16,-1, 2,15,-1, 0,14,0, 3,15,1, 8,16,-1, 5,13,2, 6,16,1, 7,17,2 ]; @@ -390,20 +201,7 @@ var openerGenerator = { case 6: // Hachispin this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(5), - shapes.getShape(4), - shapes.getShape(2), - shapes.getShape(0), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(6), shapes.getShape(1), shapes.getShape(5), shapes.getShape(4), shapes.getShape(2), shapes.getShape(0), shapes.getShape(3)); var hintDataList = [1,18,0, 0,18,0, 8,16,-1, 2,15,1, 6,17,2, 5,16,2, 1,16,2, -1,16,-1, -1,16,0, 5,16,0, 0,14,0, 3,15,0, 8,14,-1, 7,16,-1]; @@ -414,7 +212,8 @@ var openerGenerator = { } break; case 7: // Albatross - this.hintQueue = new Array(shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); + this.hintQueue = new Array( + shapes.getShape(1), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(4), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(1), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3)); var hintDataList = [1,18,0,0,17,3,8,16,3,5,17,2,6,16,2,3,16,0,1,16,2,-1,17,1,5,17,3,5,18,0,6,16,0,2,15,3,3,15,1,1,17,3]; this.createHintQueue(hintDataList); @@ -422,13 +221,7 @@ var openerGenerator = { case 8: // Number One this.hintQueue = new Array( - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(5), - shapes.getShape(3)); + shapes.getShape(1), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(3)); var hintDataList = [3,18,0, 0,17,2, 0,16,0, 4,15,-1, 6,17,0, 8,16,-1, 3,17,-1]; @@ -441,13 +234,7 @@ var openerGenerator = { case 9: // Pelican this.hintQueue = new Array( - shapes.getShape(5), - shapes.getShape(2), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6), - shapes.getShape(1), - shapes.getShape(3)); + shapes.getShape(5), shapes.getShape(2), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3)); var hintDataList = [0,17,-1, 1,16,2, 5,18,0, 5,16,-1, 8,16,-1, 5,17,0, 3,16,2]; @@ -460,17 +247,7 @@ var openerGenerator = { case 10: // O - 1, I - 6, L - 0, S - 5, J - 4, Z - 2, T - 3 // DT Cannon TSZ base this.hintQueue = new Array( - shapes.getShape(3), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(6), - shapes.getShape(5), - shapes.getShape(0), - shapes.getShape(4), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(3), - shapes.getShape(3)); + shapes.getShape(3), shapes.getShape(1), shapes.getShape(2), shapes.getShape(6), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(4), shapes.getShape(0), shapes.getShape(3), shapes.getShape(3)); var hintDataList = [4,18,0, -2,18,0, 2,17,1, 8,16,-1, 6,17,-1, 7,17,-1, 3,15,2, -1,15,1, 2,13,-1, 1,16,2, 1,17,3]; @@ -482,64 +259,37 @@ var openerGenerator = { break; case 11: this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(6), - shapes.getShape(3), - shapes.getShape(0), - shapes.getShape(2), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(5), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(1), - shapes.getShape(3), - shapes.getShape(4), - shapes.getShape(0), - shapes.getShape(6)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(3), shapes.getShape(0), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(0), shapes.getShape(6)); var hintDataList = [3,17,1,6,18,0,1,17,3,5,17,3,2,16,3,-1,17,1,4,15,0,5,13,1,3,14,0,-1,14,3,8,15,3,-1,15,0,0,13,0,6,16,2,0,13,2,4,14,0,2,13,3,6,17,1,7,18,0,3,16,1,7,17,2,6,18,0,1,18,0,-1,17,1,2,16,2,5,17,0,0,15,2,3,15,2,6,15,2,8,16,3]; this.createHintQueue(hintDataList); break case 12: this.hintQueue = new Array( - shapes.getShape(0), - shapes.getShape(1), - shapes.getShape(2), - shapes.getShape(3)); + shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3)); var hintDataList = [3,17,1,6,18,0,5,17,2,1,18,0]; this.createHintQueue(hintDataList); break; case 13: - this.hintQueue = new Array(shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); + this.hintQueue = new Array( + shapes.getShape(4), shapes.getShape(6), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(0), shapes.getShape(6), shapes.getShape(0), shapes.getShape(5), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4)); var hintDataList = [0,18,0,3,18,0,-1,17,0,7,18,0,3,17,0,8,16,3,0,15,2,-2,14,0,3,15,2,3,14,0,1,13,3,8,14,3,7,12,2,5,16,2,3,14,3,6,17,3,5,18,0]; this.createHintQueue(hintDataList); break; case 14: - this.hintQueue = new Array(shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); + this.hintQueue = new Array( + shapes.getShape(0), shapes.getShape(6), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(0), shapes.getShape(4), shapes.getShape(6), shapes.getShape(0), shapes.getShape(0), shapes.getShape(3), shapes.getShape(5)); var hintDataList = [-1,17,1,3,18,0,3,17,0,7,18,0,6,16,3,8,16,3,0,16,3,0,14,0,8,13,3,4,15,1,6,14,2,1,17,1,2,17,2]; + this.createHintQueue(hintDataList); break; case 15: - this.hintQueue = new Array(shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); + this.hintQueue = new Array( + shapes.getShape(0), shapes.getShape(2), shapes.getShape(5), shapes.getShape(6), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(2), shapes.getShape(5), shapes.getShape(0), shapes.getShape(1), shapes.getShape(6), shapes.getShape(4), shapes.getShape(3), shapes.getShape(4), shapes.getShape(5), shapes.getShape(6), shapes.getShape(0), shapes.getShape(1), shapes.getShape(2), shapes.getShape(3), shapes.getShape(4), shapes.getShape(1), shapes.getShape(3), shapes.getShape(4), shapes.getShape(3)); var hintDataList = [-1,17,1,2,18,0,4,17,3,6,18,0,6,17,0,2,15,2,-1,14,1,5,17,0,4,14,3,5,14,3,6,15,0,6,14,3,8,12,3,0,16,1,6,15,0,0,15,0,-1,12,3,6,13,1,2,15,0,3,13,0,1,17,2,5,14,1,6,15,0,2,17,3,3,15,2,1,17,2]; + this.createHintQueue(hintDataList); break; default: