fixed regression

This commit is contained in:
PolicyChanges1@gmail.com 2021-02-26 17:18:32 -05:00
parent 7df645c131
commit 7e936a91b0
3 changed files with 13 additions and 49 deletions

28
dist/tetrion.js vendored
View File

@ -2421,7 +2421,7 @@ ShapeZR.prototype = {
clone.state = this.nextState(rotationDirection);
var i = 0;
if(rotationDirection == 1)
i = 4;
i = 2;
for(; i < 5*4; i+=4)
{
var shiftX = this.rotationPoints[j][i];
@ -2445,33 +2445,15 @@ ShapeZR.prototype = {
},
//Rotate shape
rotate: function(matrix) {
// TODO: rest of pieces
//if(this.flag == 'T' || this.flag == 'L')
this.kickShape(matrix, -1);
//else if (isShapeCanMove(this, matrix, 'rotate')){
//this.state = this.nextState(-1);
//fix position if shape is out of right border
//var right = this.getRight();
//if ( right >= COLUMN_COUNT){
// this.x -= right - COLUMN_COUNT + 1;
//}
/*var left = this.getLeft();
if(left <= 0)
this.x += 1;*/
//}
},
//Rotate shape clockwise
rotateClockwise: function(matrix) {
//if(this.flag == 'T')
this.kickShape(matrix, 1);
//else if (isShapeCanMove(this, matrix, 'rotateclockwise')) {
//this.state = this.nextState(1);
//fix position if shape is out of right border
//var right = this.getRight();
//if (right >= COLUMN_COUNT) {
// this.x -= right - COLUMN_COUNT + 1;
//}
//}
},
//Caculate the max column of the shape
getColumnCount: function() {

View File

@ -36,7 +36,7 @@
<!--insert shadertoy background-->
<!--https://www.shadertoy.com/embed/wttfW2?gui=&t=10&paused=false&muted=false-->
<!--
<div id="divbg">
<iframe id="bg" width="640" height="360" frameborder="0" src="https://www.shadertoy.com/embed/WldfWX?gui=&paused=false&muted=false" ></iframe>
<script>
@ -48,7 +48,7 @@ document.getElementById("bg").removeAttribute("tabIndex");
document.getElementById("divbg").removeAttribute("tabIndex");
</script>
</div>
-->
<div id="tetris">
<canvas id="scene"></canvas>
@ -155,7 +155,7 @@ document.getElementById("divbg").removeAttribute("tabIndex");
document.getElementById("setMKOStackingVar").addEventListener("click", function() { tetrion.setCurrentOpener(3); } );
document.getElementById("setPokeminosSTDVar").addEventListener("click", function() { tetrion.setCurrentOpener(4); } );
document.getElementById("setMrTSpinsSTDreversedVar").addEventListener("click", function() { tetrion.setCurrentOpener(5); } );
//document.getElementById("setHachispinVar").addEventListener("click", function() { tetrion.setCurrentOpener(6); } );
document.getElementById("setHachispinVar").addEventListener("click", function() { tetrion.setCurrentOpener(6); } );
document.getElementById("test").addEventListener("click", function() { tetrion.setDoTest(); } );
document.getElementById("settings").addEventListener("change", function() { tetrion.updateSettingTextBox(); } );

View File

@ -667,7 +667,7 @@ ShapeZR.prototype = {
clone.state = this.nextState(rotationDirection);
var i = 0;
if(rotationDirection == 1)
i = 4;
i = 2;
for(; i < 5*4; i+=4)
{
var shiftX = this.rotationPoints[j][i];
@ -691,33 +691,15 @@ ShapeZR.prototype = {
},
//Rotate shape
rotate: function(matrix) {
// TODO: rest of pieces
//if(this.flag == 'T' || this.flag == 'L')
this.kickShape(matrix, -1);
//else if (isShapeCanMove(this, matrix, 'rotate')){
//this.state = this.nextState(-1);
//fix position if shape is out of right border
//var right = this.getRight();
//if ( right >= COLUMN_COUNT){
// this.x -= right - COLUMN_COUNT + 1;
//}
/*var left = this.getLeft();
if(left <= 0)
this.x += 1;*/
//}
},
//Rotate shape clockwise
rotateClockwise: function(matrix) {
//if(this.flag == 'T')
this.kickShape(matrix, 1);
//else if (isShapeCanMove(this, matrix, 'rotateclockwise')) {
//this.state = this.nextState(1);
//fix position if shape is out of right border
//var right = this.getRight();
//if (right >= COLUMN_COUNT) {
// this.x -= right - COLUMN_COUNT + 1;
//}
//}
},
//Caculate the max column of the shape
getColumnCount: function() {