pokeminos, fixes

pull/1/head
PolicyChanges1@gmail.com 2021-02-26 11:57:46 -05:00
parent 4ca9974dbf
commit dcbb9a1a39
4 changed files with 110 additions and 41 deletions

70
dist/tetrion.js vendored
View File

@ -880,29 +880,14 @@ Tetris.prototype = {
this.currentOpener = 0; this.currentOpener = 0;
}, },
setTKIFonzieVar: function() setCurrentOpener(opener)
{ {
this.isFreePlay = false; this.isFreePlay = false;
this.doTest = false; this.doTest = false;
this.currentOpener = 1; this.currentOpener = opener;
this._restartHandler(); this._restartHandler();
}, },
setDTCannonVar: function()
{
this.isFreePlay = false;
this.doTest = false;
this.currentOpener = 2;
this._restartHandler();
},
setMKOStackingVar: function ()
{
this.isFreePlay = false;
this.doTest = false;
this.currentOpener = 3;
this._restartHandler();
},
setDoTest: function() setDoTest: function()
{ {
if(this.isFreePlay) return; if(this.isFreePlay) return;
@ -1456,6 +1441,26 @@ var OpenerGenerator = {
shapes.getShape(4), shapes.getShape(4),
shapes.getShape(3)); shapes.getShape(3));
break; 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));
default: default:
return; return;
} }
@ -1532,7 +1537,7 @@ var OpenerGenerator = {
} }
break; break;
case 3: case 3:
//MKO Stacking // O - 1, I - 6, L - 0, S - 5, J - 4, Z - 2, T - 3 //MKO Stacking
this.hintQueue = new Array( this.hintQueue = new Array(
shapes.getShape(4), shapes.getShape(4),
shapes.getShape(5), shapes.getShape(5),
@ -1558,6 +1563,35 @@ var OpenerGenerator = {
this.hintQueue[i].state = this.hintQueue[i].nextState(hintDataList[i * 3 + 2]); this.hintQueue[i].state = this.hintQueue[i].nextState(hintDataList[i * 3 + 2]);
} }
break; break;
case 4:
//Pokemino's STD // O - 1, I - 6, L - 0, S - 5, J - 4, Z - 2, T - 3
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));
var hintDataList = [0,17,1, 0,16,0, 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, 6,15,0, 3,14,1, 6,12,-1, 6,16,1, 2,16,-1, 7,17,2 ];
for(var i = 0; i < this.hintQueue.length; i++) {
this.hintQueue[i].x = hintDataList[i * 3];
this.hintQueue[i].y = hintDataList[i * 3 + 1];
this.hintQueue[i].state = this.hintQueue[i].nextState(hintDataList[i * 3 + 2]);
}
break;
default: default:
return; return;
} }

View File

@ -136,7 +136,7 @@ document.getElementById("divbg").removeAttribute("tabIndex");
</select> </select>
<input style="width:80px;font-size:13px;background:black;color:dodgerblue;text-align:left;" type="text" id="setting_value"> <input style="width:80px;font-size:13px;background:black;color:dodgerblue;text-align:left;" type="text" id="setting_value">
<input id="submitsetting" type="submit" value="Set Setting"> <input id="submitsetting" type="submit" value="Set Setting">
<input id="test" type="submit" value="Test"> <input id="test" type="submit" value="Test Yourself">
</div> </div>
@ -150,9 +150,10 @@ document.getElementById("divbg").removeAttribute("tabIndex");
(function(){ (function(){
var tetrion = new Tetris('tetris'); var tetrion = new Tetris('tetris');
document.getElementById("setFreePlay").addEventListener("click", function() { tetrion.setFreePlay(); } ); document.getElementById("setFreePlay").addEventListener("click", function() { tetrion.setFreePlay(); } );
document.getElementById("setTKIFonzieVar").addEventListener("click", function() { tetrion.setTKIFonzieVar(); } ); document.getElementById("setTKIFonzieVar").addEventListener("click", function() { tetrion.setCurrentOpener(1); } );
document.getElementById("setDTCannonVar").addEventListener("click", function() { tetrion.setDTCannonVar(); } ); document.getElementById("setDTCannonVar").addEventListener("click", function() { tetrion.setCurrentOpener(2); } );
document.getElementById("setMKOStackingVar").addEventListener("click", function() { tetrion.setMKOStackingVar(); } ); document.getElementById("setMKOStackingVar").addEventListener("click", function() { tetrion.setCurrentOpener(3); } );
document.getElementById("setPokeminosSTDVar").addEventListener("click", function() { tetrion.setCurrentOpener(4); } );
document.getElementById("test").addEventListener("click", function() { tetrion.setDoTest(); } ); document.getElementById("test").addEventListener("click", function() { tetrion.setDoTest(); } );
document.getElementById("settings").addEventListener("change", function() { tetrion.updateSettingTextBox(); } ); document.getElementById("settings").addEventListener("change", function() { tetrion.updateSettingTextBox(); } );

View File

@ -179,29 +179,14 @@ Tetris.prototype = {
this.currentOpener = 0; this.currentOpener = 0;
}, },
setTKIFonzieVar: function() setCurrentOpener(opener)
{ {
this.isFreePlay = false; this.isFreePlay = false;
this.doTest = false; this.doTest = false;
this.currentOpener = 1; this.currentOpener = opener;
this._restartHandler(); this._restartHandler();
}, },
setDTCannonVar: function()
{
this.isFreePlay = false;
this.doTest = false;
this.currentOpener = 2;
this._restartHandler();
},
setMKOStackingVar: function ()
{
this.isFreePlay = false;
this.doTest = false;
this.currentOpener = 3;
this._restartHandler();
},
setDoTest: function() setDoTest: function()
{ {
if(this.isFreePlay) return; if(this.isFreePlay) return;

View File

@ -63,6 +63,26 @@ var OpenerGenerator = {
shapes.getShape(4), shapes.getShape(4),
shapes.getShape(3)); shapes.getShape(3));
break; 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));
default: default:
return; return;
} }
@ -139,7 +159,7 @@ var OpenerGenerator = {
} }
break; break;
case 3: case 3:
//MKO Stacking // O - 1, I - 6, L - 0, S - 5, J - 4, Z - 2, T - 3 //MKO Stacking
this.hintQueue = new Array( this.hintQueue = new Array(
shapes.getShape(4), shapes.getShape(4),
shapes.getShape(5), shapes.getShape(5),
@ -165,6 +185,35 @@ var OpenerGenerator = {
this.hintQueue[i].state = this.hintQueue[i].nextState(hintDataList[i * 3 + 2]); this.hintQueue[i].state = this.hintQueue[i].nextState(hintDataList[i * 3 + 2]);
} }
break; break;
case 4:
//Pokemino's STD // O - 1, I - 6, L - 0, S - 5, J - 4, Z - 2, T - 3
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));
var hintDataList = [0,17,1, 0,16,0, 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, 6,15,0, 3,14,1, 6,12,-1, 6,16,1, 2,16,-1, 7,17,2 ];
for(var i = 0; i < this.hintQueue.length; i++) {
this.hintQueue[i].x = hintDataList[i * 3];
this.hintQueue[i].y = hintDataList[i * 3 + 1];
this.hintQueue[i].state = this.hintQueue[i].nextState(hintDataList[i * 3 + 2]);
}
break;
default: default:
return; return;
} }