From 408d739581cbdf1d5fb2bd43211555cfc827fade Mon Sep 17 00:00:00 2001 From: "PolicyChanges1@gmail.com" Date: Fri, 12 Mar 2021 23:03:37 -0500 Subject: [PATCH] added gamestates --- dist/Affirm.ogg | Bin 0 -> 10646 bytes dist/sound/21099_45941-lq.ogg | Bin 0 -> 19416 bytes dist/tetrion.js | 215 ++++++++++++++++++++++------------ index.html | 3 +- src/consts.js | 9 ++ src/main.js | 206 ++++++++++++++++++++------------ 6 files changed, 280 insertions(+), 153 deletions(-) create mode 100644 dist/Affirm.ogg create mode 100644 dist/sound/21099_45941-lq.ogg diff --git a/dist/Affirm.ogg b/dist/Affirm.ogg new file mode 100644 index 0000000000000000000000000000000000000000..8424bdf0ceb98a524aed89306257dd5510fd327c GIT binary patch literal 10646 zcmeHtc{tSF+xVFoV{9QymNbnb+sIm$EJKTk7F+i0OQf3M$7?|Z%9_qx8<``>%6<8(e}yYF-F_n8j3xtRbo_+5ncS32(k z)g)1PRKRf`M-N|Q2)(QL_mYz*DPvg`AGUu56Xk-D!>jEO11@ zkWf$Vj5h;-8vuJTDbA~|`cip`*^)siiF=V=y?j(kVpP4LQ;b5xYC}+V<_CZYkR@5; zZjR|6ZC7&>l!)`mQuElaT0p=>AEK(UKKs7K$veM1-_yHYN}OelB^KTrkoJn6=QBnc z$4Jo&g0Q(L;?pErknY1KeJd-BO|gj(Zm9S%_v(K2kGF2dseh6z@6=_NEq`fXsL*5X zR9ek!8|>SzHlF^wVP)Kd0CCY}7INm+WkHUQl*&)>fk&-eivY;*nn3RgpZ;CGmb)Tt zU1A4jh=+K$bt&yOF*P!S#ozXDfJ<+He{VpDWy*Q$2O*XZ&Rf4ZZ##e9LGZ%wx)3rr zk5tCh2`G@YSuJT;Drb{$&X8ITCgMUd8aN{)A+RQFl1jL#pYM9K)FZ9Z{dVQCmV3mO zdmM}h5^lBFxhP;$&zFwboy))IfU7sU0Z>1N+lZGoPdYvN%xOZ|WKq)3}gHjw@F_!6Ds2OP6Z_J3D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fKHDv%qLX%6t!mONcdZhNiwdgO&n9Wf`WuK)0$ip|gu z4afF9#~h8iOfL(Y*P*A$Mw;*MO<8<$^mdAl)DZI--?A-XI>R zZ`HsjyoXeL>WF!h!KT3wiD}X(5V&Oca56durDtOUPMyWvn0boIA`6nqE^XCZ3ANC< zQsDvVs2Z34bmFEaBY=CLxO{Sy$H+n@&b?-e8bp1P0DqZv{rYZxu(tNS1@@0A2J)%t zpB|5OK9Bu4qUUrcXnFZ_Tik^}mD!oc-j&IZ4`d#DA7g&MP3(Jo^1{#MpWm9B!;Gj3 GeE$V==_X15 literal 0 HcmV?d00001 diff --git a/dist/sound/21099_45941-lq.ogg b/dist/sound/21099_45941-lq.ogg new file mode 100644 index 0000000000000000000000000000000000000000..a187e2b7bc5998031f7af0688c4e383367f66882 GIT binary patch literal 19416 zcmeIac|29^_cy-wnazg|jv)@IXb`2)Z8%8g5|su?N=b!iFx!TZ6iJhm(;(73OU231 zTvSQ}I>}Hd3K=py>*&7k&*%Hs^Ljnc^Vje7+piPbKKtx-U2Ax+_gdF=n!j$HJ5b>7 z<3?9%jQBKbnY1pUL2L^Q_E{eyzCf9CPW%giG$BTR7ZUTupZxa_e^UI8*HtZTx!EKC zeVn2GdCnw!d&&ABKmGZ^>v$X2`z#)PI?sVO-N4YmV8-;BJYCyuzQJMJ{d|Lc^~6sm z=zl(`Wo@$<#B`UFRjR zRoz|n=!f0*xUE-Noi09OJ2{NsqA+{n(beqb4)@+1+OW&&hI)cbmYcI)d8S*6HA}@k zRj(q`&C!}Uev9nvW_9;Hj=ENb*&%1IA2_gj*O@IDjx9QCoUQHkc4Rm*bKU1z+s{1k z#!YW*h?|?g)fW_LeS?=E6IYeKNIXsGGtHuT2sGC70p|Mv|l$n1Wamf&JKBQ zI`K%zeUp~#kd)xHhJJWoc8Eg!TD?DK$I6?nHWY}j-8apP-#nL#_hnscw(_6#2Cpey zJ8kN(Ux8=ZP0bFQ^k3uIb5p!!^hbemUP#b9@sm&dYF-v#t&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c z83raZ8Y1FqXBjSR>2Kdjhb1Oufo@mRBByYUM$vZ$1ImQ8TX)c>$ z)z`RTfm`(K{)Yzl7TnXb^XH9MWts?SppG0&0=olVc0*22a$TM_i9)|5*^KR3dH6Y} z;hgcdI-6ru1I-%#!K6l(k?QS9ny+Tq!=>Nl4R=Vo5 zt 0) { + this.canPopFromHoldStack = false; + this.shapeQueue.unshift(utils.deepClone(this.shape)); + this.shape = this.holdStack.pop(); + this.shape.resetOrigin(); + this._draw(); + }else if(this.holdStack.length < 4) { this.holdStack.push(utils.deepClone(this.shape)); this.shape = this.shapeQueue.shift(); this.canPopFromHoldStack = false; this.shape.resetOrigin(); this._draw(); } + /* 4 shape hold queue + if(this.holdStack.length < 4) { + this.holdStack.push(utils.deepClone(this.shape)); + this.shape = this.shapeQueue.shift(); + this.canPopFromHoldStack = false; + this.shape.resetOrigin(); + this._draw(); + }*/ }, popHoldStack: function() { + // todo: disable if 1 shape hold queue if(this.holdStack.length >= 1 && this.canPopFromHoldStack) { this.canPopFromHoldStack = false; @@ -985,7 +1027,8 @@ Tetris.prototype = { _restartHandler: function() { this.reset(); this.start(); - this._fireShape(); + //this._fireShape(); + this._recurseGameState(); }, // Bind game events _initEvents: function() { @@ -993,71 +1036,87 @@ Tetris.prototype = { setInterval(() => {this.lockDownTimer++;}, 100 ); views.btnRestart.addEventListener('click', utils.proxy(this._restartHandler, this), false); }, - - // Fill next queue and set next shape - _fireShape: function() { - if(this.isFreePlay == false) { - while(this.shapeQueue.length <= 4) - { - this.preparedShape = openers.getNextMino(this.currentOpener); - this.shapeQueue.push(this.preparedShape); - } - while(this.hintQueue.length <= 4) - { - this.preparedShape = openers.getNextHint(this.currentOpener); - this.hintQueue.push(this.preparedShape); - } - - this.hintMino = this.hintQueue.shift(); - this.shape = this.shapeQueue.shift(); - - this.currentMinoInx++; - - // Opener sequence completed - if(this.currentMinoInx > openers.getLength()) { - if(this.isTimerOn) { - var besttime = document.getElementById("besttime").value; - var deltaTime = new Date().getTime() - this.sequencePrevTime; - if(besttime == "" || deltaTime/1000.0 < parseFloat(besttime)) { - document.getElementById("besttime").value = (deltaTime/1000.0).toString(); - } - - - } - - this.hintQueue = []; - this.shapeQueue = []; - - this.isSequenceCompleted = true; - // Recursion warning - this._restartHandler(); - // this.reset(); - // this.start(); - return; - } - } else { - while(this.shapeQueue.length <= 4) - { - this.preparedShape = shapes.randomShape(); - this.shapeQueue.push(this.preparedShape); - } - - this.shape = this.shapeQueue.shift();// || shapes.randomShape(); - this.currentMinoInx++; + // Process freeplay queue + _processFreeplayQueue: function() { + while(this.shapeQueue.length <= 4) + { + this.preparedShape = shapes.randomShape(); + this.shapeQueue.push(this.preparedShape); } + this.shape = this.shapeQueue.shift();// || shapes.randomShape(); + this.currentMinoInx++; + }, + // Process opener trainer queue + _processOpenerTrainerQueue: function() { + while(this.shapeQueue.length <= 4) + { + this.preparedShape = openers.getNextMino(this.currentOpener); + this.shapeQueue.push(this.preparedShape); + } + while(this.hintQueue.length <= 4) + { + this.preparedShape = openers.getNextHint(this.currentOpener); + this.hintQueue.push(this.preparedShape); + } + + this.hintMino = this.hintQueue.shift(); + this.shape = this.shapeQueue.shift(); + + this.currentMinoInx++; + + // Opener sequence completed + if(this.currentMinoInx > openers.getLength()) { + new Audio("./dist/Affirm.ogg").play(); + if(this.isTimerOn) { + var besttime = document.getElementById("besttime").value; + var deltaTime = new Date().getTime() - this.sequencePrevTime; + if(besttime == "" || deltaTime/1000.0 < parseFloat(besttime)) { + document.getElementById("besttime").value = (deltaTime/1000.0).toString(); + } + + + } + + this.hintQueue = []; + this.shapeQueue = []; + + this.isSequenceCompleted = true; + // Recursion warning + this._restartHandler(); + // this.reset(); + // this.start(); + return; + } + }, + // Fill next queue and set next shape + _fireShape: function() { //todo:should be in shapes.js this.landed = false; this.manipulationCounter = 0; - // Reset matrix at successful end of opener - //if(this.shapeQueue.length == openers.length) { - // this.matrix = []; - // new Audio("Tetris.ogg"); - //} - + this._draw(); }, + _recurseGameState: function (){ + switch(this.gameState) { + case consts.GAMESTATES[0]: + this._processFreeplayQueue(); + this._fireShape(); + break; + case consts.GAMESTATES[1]: + this._processOpenerTrainerQueue(); + this._fireShape(); + break; + case consts.GAMESTATES[2]: + this._processOpenerTrainerQueue(); + this._fireShape(); + break; + + default: + break; + } + }, // lockdown timer with centisecond resolution resetLockdown: function() { @@ -1083,7 +1142,7 @@ Tetris.prototype = { canvas.drawShape(this.shape); canvas.drawHoldShape(this.holdStack); canvas.drawPreviewShape(this.shapeQueue); - if(this.doTest != true) + if(this.gameState != consts.GAMESTATES[2]) canvas.drawHintShape(this.hintMino); if(this.shape != undefined) { @@ -1257,8 +1316,9 @@ Tetris.prototype = { // check if the current piece is in the same location as the hint piece _checkHint: function() { - if(this.isFreePlay) + if(this.gameState == consts.GAMESTATES[0]) return; + if(!this.shape.isSameSRS(this.hintMino)) { //new Audio('./dist/Failed.ogg').play(); @@ -1277,12 +1337,15 @@ Tetris.prototype = { this.shape.copyTo(this.matrix); this._check(); if(this._checkHint()) return; - this._fireShape(); + //this._fireShape(); + this._recurseGameState(); new Audio('./dist/Blop2.ogg').play(); } this._draw(); this.isGameOver = checkGameOver(this.matrix); - views.setGameOver(this.isGameOver); + + // if game over and gamestate is free play + views.setGameOver(this.gameState == consts.GAMESTATES[0] && this.isGameOver); if (this.isGameOver) views.setFinalScore(this.score); diff --git a/index.html b/index.html index c22eaa6..4651c2d 100644 --- a/index.html +++ b/index.html @@ -50,13 +50,14 @@