From 2cfd4d854e8ef65da076ea79a430f8cb1a2424ba Mon Sep 17 00:00:00 2001 From: "PolicyChanges1@gmail.com" Date: Sat, 13 Feb 2021 09:57:33 -0500 Subject: [PATCH] revert --- dist/Blop2.ogg | Bin 0 -> 5142 bytes dist/Click.ogg | Bin 0 -> 5404 bytes dist/tetrion.js | 39 +++++++++++++++++++++------------------ index.html | 4 ++-- src/input.js | 18 +++++++++--------- src/main.js | 19 ++++++++++--------- src/openers | 31 ------------------------------- src/shapes.js | 2 ++ 8 files changed, 44 insertions(+), 69 deletions(-) create mode 100644 dist/Blop2.ogg create mode 100644 dist/Click.ogg delete mode 100644 src/openers diff --git a/dist/Blop2.ogg b/dist/Blop2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..1472d95b3a63ad90141ce163dcae1a809a68eb48 GIT binary patch literal 5142 zcmeG=eNfZamN(%mL5c_g0VA70kOUG-ATWetCj`+X5-A~366HPlh!UVy67ZEbI*kgL zAn-6miUDZ|BpL)qDDc4D&eB?t4@D3Vt!uS@e{4Ihy!YyMX4gHx1bsfY^SU#g{qNn} z+`0FhbI-Z=eB68PFMZdpOoT^EB_-O~*|@lJA1(y9_ak+#N`ry$>${dnN}R-lxO8mh z>w?Y1!HB&qKHoR<Fy+vw#@Mgi6viPkq6^&^3KHSEz>4TY2MkB}?U(usBL4}^tN++BeY zb!szLwK?G=#iKgoHkbI-pV#E=w)NSHc26CM+|jT(@$sqly2K~+zG?n4R^Js-8hd_A-kC4lv-fGHxDQ*F z8lqz#6j%%2Jt*IYPr%sg7`7%guySsTg0!$rwDBlO*h8A^AzzxIr9Wq8_{Gh{re;dT zGAL!)TlXp#_LeQ|-7jyd+%~vhK3KW!T4nZ+l{tY`OZCP6TR&pev2_X#nZvk^cNvz@ zV9On@#igRE3y<4~K@w5ZII_VUDOd8#SB@nk1+jOV^JZ(=Pof zZTTxBU}i^%$0m=IkjFtA64tCbZmVY9f=0Xms=zez_sao?zraSQCw4X#Y6-FRIS#dG zfo)(LA;r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fEQlT literal 0 HcmV?d00001 diff --git a/dist/Click.ogg b/dist/Click.ogg new file mode 100644 index 0000000000000000000000000000000000000000..e40f4d367931b1f54f5c9e830d73bf50247d3f0a GIT binary patch literal 5404 zcmeG=X;72NwjH)4fXEUcAo>zONg$|!-~%ptLs%qXlaL@mxg&ufn_D0{Sb8TSV8{Ru zLqG`NKp-d)5Ex)Y#~D;MK{kN_9j~GwjG`8!Z?>B4_LrdJ^G)4(Ra5WZ?do)$KIil~ zU!SG>bi()UjRZPirRlk7fh*bb-=fx`4j&NmlhYBDj(_6{%ONfEB~&=F@=ZflqTtMJ z+`rEJFTcLiPU~t#A>yNx4<>C47w#pbCG(>+3J6Ss+h(fUX1C4m1XB3E{mBP~f^@SP>ThQvmijl1+*enPio`hLl+*4?>{c&3R?=yk2~K zKDF=lK%ga90-y)PBy3^r0yAaAYcJlZP+0Ai9OikBfR;wgdSS1Bvmt(eeS3ZC{t@ze z%qpHf+&7>H5p!^CWZ+APxp+97vJ(yv&s7QyozGWi8M+M+PKLNWsVffiesaFH(EBN= zeT-q`+J2iALY<0=Z@y{}dn|p#Yq4@=z-snEfZxI}ut_jwU=Z;Va($T)iqdY20K{;c zVEbttvlTbgYBxOY82*wHVc{|E9uUb1<-#V4-Fa9reONSo_&BdDXV<0Uyh}N|W^!V` z%ZbD1uJrGZKll#mnynL1pxVK!bdIdFw^cs!QtD>sHtK)`#3Tf)%$_W(W!5LAG$&Vd zCSB;74`qCC-O=Kf86Ow1I~aBZP|awuK$o@0Nb%&NI`2X zJOH3i>1;}`khVRY)}QVJ`}Pd~oAQw1{|;IG+6jo;0iaXudJoy%gw|lYP6$1Arf;22 z51odlKrHgF+X+p)z>N^A5=&FW826$$jakG{EWQTgXROr(86-9H1jU%*)v%X|;&F8Y zu43X^9;d>otD&qypx9@?d#yb@`YgeS~SOP-&q|^9poR!)=JOS*$eavx$Rz z$+s2ghC9)4EpJS*aJ~x%p*(qoQ%4s^D{mz%8va%}a?R@@T#(&(%2C^DX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H(@@C b#EZT#e)(QcOIVx!e<+N$(PDx3fhF)yE6en0 literal 0 HcmV?d00001 diff --git a/dist/tetrion.js b/dist/tetrion.js index 86c330c..595b93f 100644 --- a/dist/tetrion.js +++ b/dist/tetrion.js @@ -486,7 +486,7 @@ var UserInputs = { } else { if (gamepadDASFrames >= deciARR && isContained) { - this.gamepadQueue.push(finds); + //this.gamepadQueue.push(finds); this.gamepadButtonsDeciFrames = 0; } } @@ -495,16 +495,16 @@ var UserInputs = { // Direction Pad gamepadDPadDown(finds) { - var DAS = 7.0; - var ARR = 3.0; + var DAS = 10.0; + var ARR = 5.0; var isContained = this.gpButtons.includes(finds); var isPrevContained = this.prevGpButtons.includes(finds); //console.log("but: " + this.gpButtons + " prev but:" + this.prevGpButtons); if(isPrevContained != isContained ) { this.isGamepadDown = false; // Do once - //if(isContained) - // this.gamepadQueue.push(finds); + if(isContained) + this.gamepadQueue.push(finds); } var gamepadDirectionDasFrames = this.gamepadDirectionPadDeciFrames / 1.0; if (!this.isGamepadDown) { @@ -556,7 +556,7 @@ var UserInputs = { } } else { if (keyboardDASFrames >= deciARR && this.keyboardKeys[key] == true) { - this.inputqueue.push(key); + //this.inputqueue.push(key); this.keyboardButtonsDeciframes = 0; } } @@ -572,16 +572,16 @@ var UserInputs = { }, // Direction arrows processKeyboardArrowKeys(key) { - var DAS = 8.0; + var DAS = 30.0; var ARR = 0.0; - /* do once? + if(this.prevKeyboardKeys[key] != this.keyboardKeys[key]) { this.isDirectionArrowDown = false; if(this.keyboardKeys[key] == true) this.inputqueue.push(key); } - */ + //console.log(key + " " + this.held var keyboardDASFrames = this.keyboardDirectionArrowsDeciframes / 1.0; // why isnt this 10? //console.log(keyboardDASFrames + " " + this.held); @@ -820,7 +820,7 @@ Tetris.prototype = { this.levelTime = this.startTime; this.shapeQueue = this.shapeQueue || []; this.hintQueue = this.hintQueue || []; - this.holdQueue = this.holdQueue || []; + this.holdQueue = []; this.canPullFromHoldQueue = false; clearMatrix(this.matrix); views.setLevel(this.level); @@ -887,16 +887,17 @@ Tetris.prototype = { _fireShape: function() { //this.shape = this.shapeQueue.shift() || shapes.randomShape(); + while(this.shapeQueue.length <= 4) { - this.preparedShape = shapes.randomShape();//openers.getNextMino(); + this.preparedShape = openers.getNextMino(); this.shapeQueue.push(this.preparedShape); } - /*while(this.hintQueue.length <= 4) + while(this.hintQueue.length <= 4) { this.preparedShape = openers.getNextHint(this.matrix); this.hintQueue.push(this.preparedShape); - }*/ + } //this.hintMino = this.hintQueue.shift(); this.shape = this.shapeQueue.shift();// shapes.randomShape(); @@ -1030,10 +1031,10 @@ Tetris.prototype = { this._update(); } if(curkey == 81) { - //if(document.getElementById("bg").style.display == "none") - // document.getElementById("bg").style.display = "initial"; - //else - // document.getElementById("bg").style.display="none"; + if(document.getElementById("bg").style.display == "none") + document.getElementById("bg").style.display = "initial"; + else + document.getElementById("bg").style.display="none"; } } inputs.inputqueue = []; @@ -1067,7 +1068,7 @@ Tetris.prototype = { this.shape.copyTo(this.matrix); this._check(); this._fireShape(); - new Audio('./dist/Blop.ogg').play(); + new Audio('./dist/Blop2.ogg').play(); } this._draw(); this.isGameOver = checkGameOver(this.matrix); @@ -1641,12 +1642,14 @@ ShapeZR.prototype = { //Move the shape to the left goLeft: function(matrix) { if (isShapeCanMove(this, matrix, 'left')) { + new Audio('./dist/Click.ogg').play(); this.x -= 1; } }, //Move the shape to the right goRight: function(matrix) { if (isShapeCanMove(this, matrix, 'right')) { + new Audio('./dist/Click.ogg').play(); this.x += 1; } }, diff --git a/index.html b/index.html index e7c1361..f653271 100644 --- a/index.html +++ b/index.html @@ -37,13 +37,13 @@ - +document.getElementById("bg").height = window.innerHeight;
diff --git a/src/input.js b/src/input.js index 2f00396..db241b6 100644 --- a/src/input.js +++ b/src/input.js @@ -66,7 +66,7 @@ var UserInputs = { } else { if (gamepadDASFrames >= deciARR && isContained) { - this.gamepadQueue.push(finds); + //this.gamepadQueue.push(finds); this.gamepadButtonsDeciFrames = 0; } } @@ -75,16 +75,16 @@ var UserInputs = { // Direction Pad gamepadDPadDown(finds) { - var DAS = 7.0; - var ARR = 3.0; + var DAS = 10.0; + var ARR = 5.0; var isContained = this.gpButtons.includes(finds); var isPrevContained = this.prevGpButtons.includes(finds); //console.log("but: " + this.gpButtons + " prev but:" + this.prevGpButtons); if(isPrevContained != isContained ) { this.isGamepadDown = false; // Do once - //if(isContained) - // this.gamepadQueue.push(finds); + if(isContained) + this.gamepadQueue.push(finds); } var gamepadDirectionDasFrames = this.gamepadDirectionPadDeciFrames / 1.0; if (!this.isGamepadDown) { @@ -136,7 +136,7 @@ var UserInputs = { } } else { if (keyboardDASFrames >= deciARR && this.keyboardKeys[key] == true) { - this.inputqueue.push(key); + //this.inputqueue.push(key); this.keyboardButtonsDeciframes = 0; } } @@ -152,16 +152,16 @@ var UserInputs = { }, // Direction arrows processKeyboardArrowKeys(key) { - var DAS = 8.0; + var DAS = 30.0; var ARR = 0.0; - /* do once? + if(this.prevKeyboardKeys[key] != this.keyboardKeys[key]) { this.isDirectionArrowDown = false; if(this.keyboardKeys[key] == true) this.inputqueue.push(key); } - */ + //console.log(key + " " + this.held var keyboardDASFrames = this.keyboardDirectionArrowsDeciframes / 1.0; // why isnt this 10? //console.log(keyboardDASFrames + " " + this.held); diff --git a/src/main.js b/src/main.js index 1068e12..22a46b8 100644 --- a/src/main.js +++ b/src/main.js @@ -175,7 +175,7 @@ Tetris.prototype = { this.levelTime = this.startTime; this.shapeQueue = this.shapeQueue || []; this.hintQueue = this.hintQueue || []; - this.holdQueue = this.holdQueue || []; + this.holdQueue = []; this.canPullFromHoldQueue = false; clearMatrix(this.matrix); views.setLevel(this.level); @@ -242,16 +242,17 @@ Tetris.prototype = { _fireShape: function() { //this.shape = this.shapeQueue.shift() || shapes.randomShape(); + while(this.shapeQueue.length <= 4) { - this.preparedShape = shapes.randomShape();//openers.getNextMino(); + this.preparedShape = openers.getNextMino(); this.shapeQueue.push(this.preparedShape); } - /*while(this.hintQueue.length <= 4) + while(this.hintQueue.length <= 4) { this.preparedShape = openers.getNextHint(this.matrix); this.hintQueue.push(this.preparedShape); - }*/ + } //this.hintMino = this.hintQueue.shift(); this.shape = this.shapeQueue.shift();// shapes.randomShape(); @@ -385,10 +386,10 @@ Tetris.prototype = { this._update(); } if(curkey == 81) { - //if(document.getElementById("bg").style.display == "none") - // document.getElementById("bg").style.display = "initial"; - //else - // document.getElementById("bg").style.display="none"; + if(document.getElementById("bg").style.display == "none") + document.getElementById("bg").style.display = "initial"; + else + document.getElementById("bg").style.display="none"; } } inputs.inputqueue = []; @@ -422,7 +423,7 @@ Tetris.prototype = { this.shape.copyTo(this.matrix); this._check(); this._fireShape(); - new Audio('./dist/Blop.ogg').play(); + new Audio('./dist/Blop2.ogg').play(); } this._draw(); this.isGameOver = checkGameOver(this.matrix); diff --git a/src/openers b/src/openers deleted file mode 100644 index 0b6940a..0000000 --- a/src/openers +++ /dev/null @@ -1,31 +0,0 @@ -shapes = require(./shapes.js); - - -function TKI3FonzieVariation { - - this.shapeQueue: [], - -} - -TKI3FonzieVariation.prototype = { - init: function () { - this.shapeQueue.push(new ShapeL()); - this.shapeQueue.push(new ShapeI()); - this.shapeQueue.push(new ShapeO()); - this.shapeQueue.push(new ShapeS()); - this.shapeQueue.push(new ShapeZ()); - this.shapeQueue.push(new ShapeJ()); - this.shapeQueue.push(new ShapeT()); - } - - //hintShape -} - -function getNewOpener() -{ - var opener = new TKI3FonzieVariation() - opener.init(); - return opener; -} -//var Openers = { - diff --git a/src/shapes.js b/src/shapes.js index e8b59bf..65cf09a 100644 --- a/src/shapes.js +++ b/src/shapes.js @@ -360,12 +360,14 @@ ShapeZR.prototype = { //Move the shape to the left goLeft: function(matrix) { if (isShapeCanMove(this, matrix, 'left')) { + new Audio('./dist/Click.ogg').play(); this.x -= 1; } }, //Move the shape to the right goRight: function(matrix) { if (isShapeCanMove(this, matrix, 'right')) { + new Audio('./dist/Click.ogg').play(); this.x += 1; } },