added sound

main
PolicyChanges1@gmail.com 2021-03-12 23:06:51 -05:00
parent 408d739581
commit 8b1e2d16c6
10 changed files with 8 additions and 8 deletions

Binary file not shown.

8
dist/tetrion.js vendored
View File

@ -1067,7 +1067,7 @@ Tetris.prototype = {
// Opener sequence completed // Opener sequence completed
if(this.currentMinoInx > openers.getLength()) { if(this.currentMinoInx > openers.getLength()) {
new Audio("./dist/Affirm.ogg").play(); new Audio("./dist/sound/Affirm.ogg").play();
if(this.isTimerOn) { if(this.isTimerOn) {
var besttime = document.getElementById("besttime").value; var besttime = document.getElementById("besttime").value;
var deltaTime = new Date().getTime() - this.sequencePrevTime; var deltaTime = new Date().getTime() - this.sequencePrevTime;
@ -1339,7 +1339,7 @@ Tetris.prototype = {
if(this._checkHint()) return; if(this._checkHint()) return;
//this._fireShape(); //this._fireShape();
this._recurseGameState(); this._recurseGameState();
new Audio('./dist/Blop2.ogg').play(); new Audio('./dist/sound/Blop2.ogg').play();
} }
this._draw(); this._draw();
this.isGameOver = checkGameOver(this.matrix); this.isGameOver = checkGameOver(this.matrix);
@ -2735,14 +2735,14 @@ ShapeZR.prototype = {
//Move the shape to the left //Move the shape to the left
goLeft: function(matrix) { goLeft: function(matrix) {
if (isShapeCanMove(this, matrix, 'left')) { if (isShapeCanMove(this, matrix, 'left')) {
new Audio('./dist/Click.ogg').play(); new Audio('./dist/sound/Click.ogg').play();
this.x -= 1; this.x -= 1;
} }
}, },
//Move the shape to the right //Move the shape to the right
goRight: function(matrix) { goRight: function(matrix) {
if (isShapeCanMove(this, matrix, 'right')) { if (isShapeCanMove(this, matrix, 'right')) {
new Audio('./dist/Click.ogg').play(); new Audio('./dist/sound/Click.ogg').play();
this.x += 1; this.x += 1;
} }
}, },

View File

@ -383,7 +383,7 @@ Tetris.prototype = {
// Opener sequence completed // Opener sequence completed
if(this.currentMinoInx > openers.getLength()) { if(this.currentMinoInx > openers.getLength()) {
new Audio("./dist/Affirm.ogg").play(); new Audio("./dist/sound/Affirm.ogg").play();
if(this.isTimerOn) { if(this.isTimerOn) {
var besttime = document.getElementById("besttime").value; var besttime = document.getElementById("besttime").value;
var deltaTime = new Date().getTime() - this.sequencePrevTime; var deltaTime = new Date().getTime() - this.sequencePrevTime;
@ -655,7 +655,7 @@ Tetris.prototype = {
if(this._checkHint()) return; if(this._checkHint()) return;
//this._fireShape(); //this._fireShape();
this._recurseGameState(); this._recurseGameState();
new Audio('./dist/Blop2.ogg').play(); new Audio('./dist/sound/Blop2.ogg').play();
} }
this._draw(); this._draw();
this.isGameOver = checkGameOver(this.matrix); this.isGameOver = checkGameOver(this.matrix);

View File

@ -795,14 +795,14 @@ ShapeZR.prototype = {
//Move the shape to the left //Move the shape to the left
goLeft: function(matrix) { goLeft: function(matrix) {
if (isShapeCanMove(this, matrix, 'left')) { if (isShapeCanMove(this, matrix, 'left')) {
new Audio('./dist/Click.ogg').play(); new Audio('./dist/sound/Click.ogg').play();
this.x -= 1; this.x -= 1;
} }
}, },
//Move the shape to the right //Move the shape to the right
goRight: function(matrix) { goRight: function(matrix) {
if (isShapeCanMove(this, matrix, 'right')) { if (isShapeCanMove(this, matrix, 'right')) {
new Audio('./dist/Click.ogg').play(); new Audio('./dist/sound/Click.ogg').play();
this.x += 1; this.x += 1;
} }
}, },