From 807dd214fdc03ef6431f4047ea8eae559cceef18 Mon Sep 17 00:00:00 2001 From: Khristan Yates Date: Mon, 22 Jul 2013 19:52:17 -0500 Subject: [PATCH] added score functionality --- puzzlepush/prototype.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/puzzlepush/prototype.html b/puzzlepush/prototype.html index 463389a..8c67c97 100644 --- a/puzzlepush/prototype.html +++ b/puzzlepush/prototype.html @@ -181,7 +181,7 @@ var horizPlacementTracker = 0; //TRACKS THE HORIZONTAL PLACEMENT OF THE TILES. - var bgImages=new Array("fire22.png","fridge42.png","plugs3.png","stove41.png","washmach42.png"); + var bgImages=new Array("Images/fire22.png","Images/fridge42.png","Images/plugs3.png","Images/stove41.png","Images/washmach42.png"); /*var imgArray = new Array("image1","image2","image3","image4","image5");*/ //=============================================================================================================== @@ -231,6 +231,7 @@ var tiles=new Array(); var movingItems=0; var gameState="pick"; + var currentscore=0; //var gameState="array"; //GAME STATE SWITCH 07162013 @@ -307,7 +308,9 @@ tileFade(); gameState="remove"; checkMoving(); - console.log("done"); + console.log("done matching;"+currentscore); + //call postscore + //postscore(currentscore); } //End of function changeRow.... //LOOK FOR MATCH.... @@ -387,6 +390,8 @@ $("#gamefield").append('
'); $("#tile_0_"+i).css({"top":"10px","left":(i*60)+10+"px","width":"50px","height":"50px","position":"absolute","border":"1px solid white","cursor":"pointer","background-image":"url('"+bgImages[tiles[0][i]]+"')"}); tilesPlaced++; + currentscore++; + } } if(tilesPlaced){ @@ -414,6 +419,8 @@ else{ gameState="pick"; selectedRow=-1; + console.log("score"+currentscore); + postscore(currentscore); } } }