diff --git a/Games/Flip_and_match_cards/Preview/Flip_And_Match_Cards_01.png b/Games/Flip_and_match_cards/Preview/Flip_And_Match_Cards_01.png new file mode 100644 index 0000000000..7e5636f590 Binary files /dev/null and b/Games/Flip_and_match_cards/Preview/Flip_And_Match_Cards_01.png differ diff --git a/Games/Flip_and_match_cards/Preview/Flip_And_Match_Cards_02.png b/Games/Flip_and_match_cards/Preview/Flip_And_Match_Cards_02.png new file mode 100644 index 0000000000..acb7fb75f7 Binary files /dev/null and b/Games/Flip_and_match_cards/Preview/Flip_And_Match_Cards_02.png differ diff --git a/Games/Flip_and_match_cards/images/high-volume.png b/Games/Flip_and_match_cards/images/high-volume.png new file mode 100644 index 0000000000..097715fb7a Binary files /dev/null and b/Games/Flip_and_match_cards/images/high-volume.png differ diff --git a/Games/Flip_and_match_cards/images/icon1.png b/Games/Flip_and_match_cards/images/icon1.png new file mode 100644 index 0000000000..7d28b47c53 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon1.png differ diff --git a/Games/Flip_and_match_cards/images/icon10.png b/Games/Flip_and_match_cards/images/icon10.png new file mode 100644 index 0000000000..7445477cbb Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon10.png differ diff --git a/Games/Flip_and_match_cards/images/icon11.png b/Games/Flip_and_match_cards/images/icon11.png new file mode 100644 index 0000000000..adff3a1336 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon11.png differ diff --git a/Games/Flip_and_match_cards/images/icon12.png b/Games/Flip_and_match_cards/images/icon12.png new file mode 100644 index 0000000000..5ad76f5d04 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon12.png differ diff --git a/Games/Flip_and_match_cards/images/icon13.png b/Games/Flip_and_match_cards/images/icon13.png new file mode 100644 index 0000000000..8a5c7ef630 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon13.png differ diff --git a/Games/Flip_and_match_cards/images/icon14.png b/Games/Flip_and_match_cards/images/icon14.png new file mode 100644 index 0000000000..60890deb8e Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon14.png differ diff --git a/Games/Flip_and_match_cards/images/icon15.png b/Games/Flip_and_match_cards/images/icon15.png new file mode 100644 index 0000000000..446044edc5 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon15.png differ diff --git a/Games/Flip_and_match_cards/images/icon16.jpg b/Games/Flip_and_match_cards/images/icon16.jpg new file mode 100644 index 0000000000..9f264f6d9d Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon16.jpg differ diff --git a/Games/Flip_and_match_cards/images/icon17.png b/Games/Flip_and_match_cards/images/icon17.png new file mode 100644 index 0000000000..abf6baa6b8 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon17.png differ diff --git a/Games/Flip_and_match_cards/images/icon18.jpg b/Games/Flip_and_match_cards/images/icon18.jpg new file mode 100644 index 0000000000..2648b99128 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon18.jpg differ diff --git a/Games/Flip_and_match_cards/images/icon2.png b/Games/Flip_and_match_cards/images/icon2.png new file mode 100644 index 0000000000..2fa68a34d0 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon2.png differ diff --git a/Games/Flip_and_match_cards/images/icon3.jpg b/Games/Flip_and_match_cards/images/icon3.jpg new file mode 100644 index 0000000000..6e73cc26fe Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon3.jpg differ diff --git a/Games/Flip_and_match_cards/images/icon4.png b/Games/Flip_and_match_cards/images/icon4.png new file mode 100644 index 0000000000..8fbee1b07f Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon4.png differ diff --git a/Games/Flip_and_match_cards/images/icon5.jpg b/Games/Flip_and_match_cards/images/icon5.jpg new file mode 100644 index 0000000000..085adafc61 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon5.jpg differ diff --git a/Games/Flip_and_match_cards/images/icon6.jpg b/Games/Flip_and_match_cards/images/icon6.jpg new file mode 100644 index 0000000000..a530769995 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon6.jpg differ diff --git a/Games/Flip_and_match_cards/images/icon7.jpg b/Games/Flip_and_match_cards/images/icon7.jpg new file mode 100644 index 0000000000..c011435bc9 Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon7.jpg differ diff --git a/Games/Flip_and_match_cards/images/icon8.png b/Games/Flip_and_match_cards/images/icon8.png new file mode 100644 index 0000000000..da27b7aa8d Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon8.png differ diff --git a/Games/Flip_and_match_cards/images/icon9.png b/Games/Flip_and_match_cards/images/icon9.png new file mode 100644 index 0000000000..d609a2605b Binary files /dev/null and b/Games/Flip_and_match_cards/images/icon9.png differ diff --git a/Games/Flip_and_match_cards/images/music-note (1).png b/Games/Flip_and_match_cards/images/music-note (1).png new file mode 100644 index 0000000000..dc823affcc Binary files /dev/null and b/Games/Flip_and_match_cards/images/music-note (1).png differ diff --git a/Games/Flip_and_match_cards/images/pokeball2.png b/Games/Flip_and_match_cards/images/pokeball2.png new file mode 100644 index 0000000000..48eb0d86d4 Binary files /dev/null and b/Games/Flip_and_match_cards/images/pokeball2.png differ diff --git a/Games/Flip_and_match_cards/index.html b/Games/Flip_and_match_cards/index.html new file mode 100644 index 0000000000..6ced05724b --- /dev/null +++ b/Games/Flip_and_match_cards/index.html @@ -0,0 +1,184 @@ + + + + + + Flip-And-Match-Game + + + + + +
+ +
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+

Flip 'n' Match

+
+ +
+
+
    +
  • Play
  • +
  • + +

    Easy

    + +
  • +
+
    +
  • +
  • +
+
+
+ + +
+ + + + + \ No newline at end of file diff --git a/Games/Flip_and_match_cards/index.js b/Games/Flip_and_match_cards/index.js new file mode 100644 index 0000000000..10eb173cd9 --- /dev/null +++ b/Games/Flip_and_match_cards/index.js @@ -0,0 +1,258 @@ +var openedCards=[]; +var sound=1,music=0; + +var imgNumbers=["1.png","2.png","3.jpg","4.png","5.jpg","6.jpg","7.jpg","8.png","9.png","10.png","11.png","12.png","13.png","14.png","15.png","16.jpg","17.png","18.jpg"]; + +var selectedImgs=[]; +for(var i=1,k=1;i<=8;i++,k+=2) +{ + var index=Math.floor(Math.random()*imgNumbers.length); + + $("#cell"+k+" .back_view img").attr("src","./images/icon"+imgNumbers[index]); + + selectedImgs.push(imgNumbers.splice(index,1)); +} +for(var i=1,k=2;i<=8;i++,k+=2) +{ + var index=Math.floor(Math.random()*selectedImgs.length); + $("#cell"+k+" .back_view img").attr("src","./images/icon"+selectedImgs[index]); + // alert(selectedImgs[index]+extensions[k]); + selectedImgs.splice(index,1); +} + +var aud=new Audio("./sounds/BGM.mp3"); +aud.play(); +$(aud).prop("volume",0.3); +// aud.autoplay; + +$(".sounds li").click(function() +{ + $("#"+$(this).attr("id")).toggleClass("clicked"); + if($(this).attr("id")=="music") + { + music=1-music; + if(music) aud.play(); + else aud.pause(); + } + else + { + sound=1-sound; + // alert(sound+"=sound"); + } + +}); + +// $(".score_menu #score").text("Your Score : "+score); +// $(".score_menu #maxScore").text("High Score : "+maxScore); +//For switching between Game and home screens +$("#play").click(function() +{ + $(".game_screen").slideDown(1); + $(".game_screen").css("display","flex"); + $(".home_screen").css("display","none"); + +}); +var difficulty=["Easy","Medium","Hard"]; +var i=0; + +$("#left").css("visibility","hidden"); + +$("#level i").click(function(){ + var clickedIcon = $(this).attr("id"); + if(clickedIcon=="left") + { + i=( i===0 ? 2 : i-1 ); + } + else + { + i=( i===2 ? 0 : i+1 ); + } + + if(i===0) + { + $("#left").css("visibility","hidden"); + } + else + { + $("#left").css("visibility","visible"); + } + if(i===2) + { + $("#right").css("visibility","hidden"); + } + else + { + $("#right").css("visibility","visible"); + } + + $("#level p").text(difficulty[i]); + if(sound==1) + { + var aud=new Audio("./sounds/click.wav"); + aud.playbackRate=2.5; + aud.play(); + } +}); + +var currNoOfPairs=(i+2)*(i+2)*2; + +// $(".exit_menu h2").click(function() +// { +// $(".home_screen").slideUp(1000); +// $(".home_screen").css("display","flex"); +// $(".game_screen").css("display","none"); + +// if(sound==1) +// { +// var aud=new Audio("./sounds/click.wav"); +// aud.playbackRate=2.5; +// aud.play(); +// } + + +// }); + +$("li:not(#level)").click(function() +{ + if(sound==1) + { + var aud=new Audio("./sounds/click.wav"); + aud.playbackRate=2.5; + aud.play(); + } + +}); + +// For flipping the cards +$(".front_view").addClass("visible"); + +$(".grid_cell .front_view").click(function() +{ + if(openedCards.length<2) + { + var cellId = $(this).parent().attr("id"); + + if(sound==1) + { + var aud=new Audio("./sounds/open_card.mp3"); + aud.playbackRate=2.5; + aud.play(); + } + + + + + $("#"+cellId).css("transform","perspective(600px) rotateY(180deg)").css("transition"," transform 0.5s ease-out"); + + + setTimeout(function(){ + $("#"+cellId +" .front_view").toggleClass("visible"); + $("#"+cellId +" .back_view").toggleClass("visible"); + },150); + + openedCards.push(cellId); + checkCards(); + } +}); +// $(".grid_cell .back_view").click(function() +// { +// // var cellId = $(this).parent().attr("id"); + +// // $("#"+cellId).css("transform","perspective(600px) rotateY(0deg)").css("transition"," transform 0.5s ease-out"); +// // setTimeout(function(){ +// // $("#"+cellId +" .front_view").toggleClass("visible"); +// // $("#"+cellId +" .back_view").toggleClass("visible"); +// // },150); + +// $("div.grid_cell").css("transform","perspective(600px) rotateY(0deg)").css("transition"," transform 0.5s ease-out "); +// setTimeout(function(){ +// $(" .front_view").addClass("visible"); +// $(" .back_view").removeClass("visible"); +// },150); + +// }); +function flipBackTheCards() +{ + $("div.grid_cell").css("transform","perspective(600px) rotateY(0deg)").css("transition"," transform 0.5s ease-out "); + + setTimeout(function(){ + $(" .front_view").addClass("visible"); + $(" .back_view").removeClass("visible"); + },150); + + // $("div.grid_cell").effect("shake",{times:10},1000); + + + if(sound==1) + { + var aud=new Audio("./sounds/wrong_card.mp3"); + aud.playbackRate=4; + $(aud).prop("volume",0.15); + aud.play(); + } + + + setTimeout(function() + { + openedCards=[]; + },1000); + +} + + +//function for storing user's input +// function openCard(cellId) +// { +// // alert(openedCards.length); +// } + +// function to check if user's input is correct or not +function checkCards() +{ + var img0=$("#"+openedCards[0]+" .back_view img").attr("src"); + var img1=$("#"+openedCards[1]+" .back_view img").attr("src"); + if(openedCards.length===2) + { + var cell1,cell2; + cell1="#"+openedCards[0]; + cell2="#"+openedCards[1]; + if(img0===img1) + { + setTimeout(function(){ + // score++; + // if(maxScore