diff options
Diffstat (limited to 'examples/English_Alphabet_Puzzle_Solving')
55 files changed, 0 insertions, 297 deletions
diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/audio/correct.ogg b/examples/English_Alphabet_Puzzle_Solving/assets/audio/correct.ogg Binary files differdeleted file mode 100755 index a0d9e3a..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/audio/correct.ogg +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/1.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/1.png Binary files differdeleted file mode 100755 index 228dee5..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/1.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/10.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/10.png Binary files differdeleted file mode 100755 index fe2fcd5..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/10.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/11.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/11.png Binary files differdeleted file mode 100755 index 1ee13fa..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/11.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/12.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/12.png Binary files differdeleted file mode 100755 index 26bfe83..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/12.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/13.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/13.png Binary files differdeleted file mode 100755 index 520e86b..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/13.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/14.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/14.png Binary files differdeleted file mode 100755 index b9fe502..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/14.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/15.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/15.png Binary files differdeleted file mode 100755 index 3240769..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/15.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/16.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/16.png Binary files differdeleted file mode 100755 index 60d1ba0..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/16.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/2.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/2.png Binary files differdeleted file mode 100755 index ce9ac3c..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/2.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/3.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/3.png Binary files differdeleted file mode 100755 index 9531865..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/3.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/4.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/4.png Binary files differdeleted file mode 100755 index f436bcd..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/4.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/5.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/5.png Binary files differdeleted file mode 100755 index af7f7c4..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/5.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/6.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/6.png Binary files differdeleted file mode 100755 index ed048ae..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/6.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/7.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/7.png Binary files differdeleted file mode 100755 index b71da02..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/7.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/8.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/8.png Binary files differdeleted file mode 100755 index 5b32426..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/8.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/9.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/9.png Binary files differdeleted file mode 100755 index ca2c60d..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/9.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/img1.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/img1.png Binary files differdeleted file mode 100755 index 4d0c15b..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img1/img1.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/1.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/1.png Binary files differdeleted file mode 100755 index b85d3cf..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/1.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/10.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/10.png Binary files differdeleted file mode 100755 index 5b05c21..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/10.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/11.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/11.png Binary files differdeleted file mode 100755 index 2ad0a9d..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/11.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/12.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/12.png Binary files differdeleted file mode 100755 index 405154e..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/12.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/13.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/13.png Binary files differdeleted file mode 100755 index 21d5408..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/13.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/14.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/14.png Binary files differdeleted file mode 100755 index 632d9c8..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/14.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/15.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/15.png Binary files differdeleted file mode 100755 index 2acc8e3..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/15.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/16.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/16.png Binary files differdeleted file mode 100755 index 55603f1..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/16.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/2.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/2.png Binary files differdeleted file mode 100755 index f9cecf8..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/2.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/3.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/3.png Binary files differdeleted file mode 100755 index f72c8c9..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/3.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/4.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/4.png Binary files differdeleted file mode 100755 index 3baa0f1..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/4.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/5.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/5.png Binary files differdeleted file mode 100755 index 21e35dd..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/5.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/6.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/6.png Binary files differdeleted file mode 100755 index 96cbb6e..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/6.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/7.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/7.png Binary files differdeleted file mode 100755 index b009529..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/7.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/8.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/8.png Binary files differdeleted file mode 100755 index 6e6d65e..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/8.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/9.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/9.png Binary files differdeleted file mode 100755 index 98b54eb..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/9.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/img2.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/img2.png Binary files differdeleted file mode 100755 index cf91a83..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img2/img2.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/1.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/1.png Binary files differdeleted file mode 100755 index d8aa161..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/1.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/10.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/10.png Binary files differdeleted file mode 100755 index e5aa0b6..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/10.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/11.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/11.png Binary files differdeleted file mode 100755 index a0006f3..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/11.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/12.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/12.png Binary files differdeleted file mode 100755 index 1ae0a06..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/12.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/13.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/13.png Binary files differdeleted file mode 100755 index 5018862..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/13.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/14.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/14.png Binary files differdeleted file mode 100755 index f96e47a..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/14.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/15.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/15.png Binary files differdeleted file mode 100755 index 57fc10c..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/15.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/16.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/16.png Binary files differdeleted file mode 100755 index 67d4454..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/16.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/2.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/2.png Binary files differdeleted file mode 100755 index 782c956..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/2.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/3.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/3.png Binary files differdeleted file mode 100755 index c9d9cd3..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/3.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/4.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/4.png Binary files differdeleted file mode 100755 index 741c750..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/4.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/5.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/5.png Binary files differdeleted file mode 100755 index 9babc2f..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/5.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/6.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/6.png Binary files differdeleted file mode 100755 index de13592..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/6.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/7.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/7.png Binary files differdeleted file mode 100755 index 7689919..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/7.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/8.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/8.png Binary files differdeleted file mode 100755 index fa5daba..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/8.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/9.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/9.png Binary files differdeleted file mode 100755 index 88cd312..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/9.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/img3.png b/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/img3.png Binary files differdeleted file mode 100755 index 21099d1..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/assets/image/img3/img3.png +++ /dev/null diff --git a/examples/English_Alphabet_Puzzle_Solving/css/lesson.css b/examples/English_Alphabet_Puzzle_Solving/css/lesson.css deleted file mode 100755 index a77a19b..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/css/lesson.css +++ /dev/null @@ -1,51 +0,0 @@ -body { - background: #affafc; - } - -#gamearea{ - float:right; - width: 664px; - border: 5px gold dashed; - padding: 10px; -} - -#feedback_image #img1,#img2,#img3 { - display: none; -} - -.dragme { - width: 160px; - height: 120px; - padding: 1px 3px 0px 3px; /*top right bottom left*/ - cursor: move; - -} - -#imageBar{ - margin-left: 20px; - margin-top:15px; - float:left; - width: 225px; - height: 495px; - border: 2px solid red; - -} - -.imageThumb{ - margin: 5px; - width: 200px; - height: 138px; - border: 2px groove #00FF00; - padding: 5px; - margin 1em; -} - -.imgMain{ - width: 640px; - height: 480px; - float : right; - padding : 10px; - visibility: hidden; - position:relative; -} -
\ No newline at end of file diff --git a/examples/English_Alphabet_Puzzle_Solving/index.html b/examples/English_Alphabet_Puzzle_Solving/index.html deleted file mode 100755 index f0cc0fa..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/index.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE HTML> -<html> - <head> - <title> English_Alphabet Puzzle Solving Game </title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta http-equiv="Content-Language" content="en-us" /> - <meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal,image puzzle" /> - <link type="image/ico" rel="icon" href="../../assets/default/image/favicon.ico" /> - <link rel="stylesheet" type="text/css" href="css/lesson.css" /> - <script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script> - <script type="text/javascript" src="../../js/karma.js"></script> - <script type="text/javascript" src="js/lesson.js"></script> - </head> - <body> - <div id = "imageBar"> - <a href="#" id="anchorImg1"><img class="imageThumb" src="assets/image/img1/img1.png" alt="" /></a> - <a href="#" id="anchorImg2"><img class="imageThumb" src="assets/image/img2/img2.png" alt="" /></a> - <a href="#" id="anchorImg3"><img class="imageThumb" src="assets/image/img3/img3.png" alt="" /></a> - </div> - <div id="gamearea"> - <div id="feedback_image"> - <img id="img1" src="assets/image/img1/img1.png" alt=""/> - <img id="img2" src="assets/image/img2/img2.png" alt=""/> - <img id="img3" src="assets/image/img3/img3.png" alt=""/> - </div> - </div> - </body> -</html>
\ No newline at end of file diff --git a/examples/English_Alphabet_Puzzle_Solving/js/lesson.js b/examples/English_Alphabet_Puzzle_Solving/js/lesson.js deleted file mode 100755 index 2e2018a..0000000 --- a/examples/English_Alphabet_Puzzle_Solving/js/lesson.js +++ /dev/null @@ -1,218 +0,0 @@ -$(document).ready(function() { - var k = Karma({ - audio: [{'name':'correct','file':'correct.ogg'}]}); - - k.ready(function(){ - - //initialize the variables used and display initial value - var drag_no = 0; //store the current dragged no - var drop_no = 0; //store the current dropped on no - var imgrand = []; //stores the random variables generated - var imgPosition = []; //stores the position of the random variable - var drag_position = 0; //position of dragged object - var drop_position = 0; //position of dropped object - var flag, i ,j; - var moves_count = 0; - var imgPath; - - - var feedbackImage = $('#feedback_image'); - for(var i=0; i<16; i++){ - feedbackImage.append("<img class='dragme' id='imgdrag" + - i + "' draggable='true' src='' alt='' />"); - } - - - game("img1"); - - $('a#anchorImg1').click(function(){ - $("#"+imgPath+"").hide(); - $(".dragme").show(); - game("img1"); - - - }); - - $('a#anchorImg2').click(function(){ - $("#"+imgPath+"").hide(); - $(".dragme").show(); - game("img2"); - - }); - - $('a#anchorImg3').click(function(){ - $("#"+imgPath+"").hide(); - $(".dragme").show(); - game("img3"); - - }); - - function generate_random_no() { //generate random number - var rand_no = Math.ceil(16*Math.random()); - return rand_no; - } - - //update the Random variable number according to the position - //update number according to the position and the value - function update_Numbers_position(){ - imgrand[drag_position] = drop_no; - imgrand[drop_position] = drag_no; - } - - //Check the game over - function check_game_over(){ - var x = 0; - for(i=0;i<16;i++){ - if(imgrand[i] == i+1){ - x++; - } - } - if(x == 16){ //puzzle solved . Hurray - k.audio.correct.play(); - $(".dragme").hide(); - $("#"+imgPath+"").fadeIn(5000); - - - } - } - - function game(imgPuzzle){ //draws the necessary random numbers for the game - imgPath = imgPuzzle; - imgrand[0]=generate_random_no(); //1 number generated, 3 different numbers to be generated - for(i=1; i<16; i++){ - do{ - flag = 0; - imgrand[i] = generate_random_no(); - for(j=0; j<i; j++){ - if(imgrand[i]===imgrand[j]){ - flag++; - } - } - }while(flag != 0 ); //end of do while loop - } - - for(i=0; i<16; i++){ - imgPosition[i] = i; - document.getElementById("imgdrag"+i+"").src = "assets/image/"+imgPath+"/"+imgrand[i]+".png"; - } - - } //end of game() - $('#feedback_image').bind('dragstart', function(ev) { - if (!$(ev.target).hasClass('dragme')) - return true; - switch (ev.target.id) { - case 'imgdrag0': - drag_no = imgrand[0]; drag_position = 0; break; - case 'imgdrag1': - drag_no = imgrand[1]; drag_position = 1; break; - case 'imgdrag2': - drag_no = imgrand[2]; drag_position = 2; break; - case 'imgdrag3': - drag_no = imgrand[3]; drag_position = 3; break; - case 'imgdrag4': - drag_no = imgrand[4]; drag_position = 4; break; - case 'imgdrag5': - drag_no = imgrand[5]; drag_position = 5; break; - case 'imgdrag6': - drag_no = imgrand[6]; drag_position = 6; break; - case 'imgdrag7': - drag_no = imgrand[7]; drag_position = 7; break; - case 'imgdrag8': - drag_no = imgrand[8]; drag_position = 8; break; - case 'imgdrag9': - drag_no = imgrand[9]; drag_position = 9; break; - case 'imgdrag10': - drag_no = imgrand[10]; drag_position = 10; break; - case 'imgdrag11': - drag_no = imgrand[11]; drag_position = 11; break; - case 'imgdrag12': - drag_no = imgrand[12]; drag_position = 12; break; - case 'imgdrag13': - drag_no = imgrand[13]; drag_position = 13; break; - case 'imgdrag14': - drag_no = imgrand[14]; drag_position = 14; break; - case 'imgdrag15': - drag_no = imgrand[15]; drag_position = 15; break; - } - - //document.display.dragBox.value = drag_no; - //document.display.dragPos.value = drag_position; - - return true; - }); - - // Set up the drop zone. - $('#feedback_image').bind('dragenter', function(ev) { // Update the drop zone class on drag enter/leave - if (!$(ev.target).hasClass('dragme')) return true; - $(ev.target).addClass('dragover'); return false; - }) - - .bind('dragleave', function(ev) { - if (!$(ev.target).hasClass('dragme')) return true; - $(ev.target).removeClass('dragover'); return false; - }) - - // Allow drops of any kind into the zone. - .bind('dragover', function(ev) { - if (!$(ev.target).hasClass('dragme')) return true; - return false; - }) - - // Handle the final drop... - .bind('drop', function(ev) { - if (!$(ev.target).hasClass('dragme')) return true; - switch (ev.target.id) { - case 'imgdrag0': - drop_no = imgrand[0]; drop_position = 0; break; - case 'imgdrag1': - drop_no = imgrand[1]; drop_position = 1; break; - case 'imgdrag2': - drop_no = imgrand[2]; drop_position = 2; break; - case 'imgdrag3': - drop_no = imgrand[3]; drop_position = 3; break; - case 'imgdrag4': - drop_no = imgrand[4]; drop_position = 4; break; - case 'imgdrag5': - drop_no = imgrand[5]; drop_position = 5; break; - case 'imgdrag6': - drop_no = imgrand[6]; drop_position = 6; break; - case 'imgdrag7': - drop_no = imgrand[7]; drop_position = 7; break; - case 'imgdrag8': - drop_no = imgrand[8]; drop_position = 8; break; - case 'imgdrag9': - drop_no = imgrand[9]; drop_position = 9; break; - case 'imgdrag10': - drop_no = imgrand[10]; drop_position = 10; break; - case 'imgdrag11': - drop_no = imgrand[11]; drop_position = 11; break; - case 'imgdrag12': - drop_no = imgrand[12]; drop_position = 12; break; - case 'imgdrag13': - drop_no = imgrand[13]; drop_position = 13; break; - case 'imgdrag14': - drop_no = imgrand[14]; drop_position = 14; break; - case 'imgdrag15': - drop_no = imgrand[15]; drop_position = 15; break; - } - - moves_count++; - //document.display.dropBox.value = drop_no; - //document.display.dropPos.value = drop_position; - //document.display.moves.value = moves_count; - - document.getElementById("imgdrag"+imgPosition[drag_position]+"").src = "assets/image/"+imgPath+"/"+drop_no+".png"; - document.getElementById("imgdrag"+imgPosition[drop_position]+"").src = "assets/image/"+imgPath+"/"+drag_no+".png"; - - update_Numbers_position(); - - - //Game over condition - check_game_over(); - - ev.stopPropagation(); - return false; - }); - - }); -}); //end of document.ready |