Below are images which Twitter users have described as having the
Same Energy.
Your challenge: match the 6 pairs.
You made 0 mistakes!
Your Energy Rating: High NRG
");
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
");
}
function loadoptions() {
extnd = "b";
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
");
jQuery("#options").append("
+extnd+%22.jpg)
");
}
function loadround() {
// load cards
jQuery("#options").html("");
loadarrayofcards();
loadquestion();
loadoptions();
lastans = -1;
mistakes = 0;
canplay = 0;
round = 0;
correct = 0;
jQuery("body").removeClass("gameover");
// shuffle order
var cards = jQuery(".cardarea");
for(var i = 0; i < cards.length; i++){
var target = Math.floor(Math.random() * cards.length -1) + 1;
var target2 = Math.floor(Math.random() * cards.length -1) +1;
cards.eq(target).before(cards.eq(target2));
}
jQuery("#instructions").text("Select an image");
}
function playagain() {
loadround();
}
function selectcard(card) {
// ignore clicks on selected or won cards
if (jQuery( card ).hasClass( "won" )) {
return false;
}
if (jQuery( card ).hasClass( "lose" )) {
return false;
}
if (jQuery( card ).hasClass( "selected" )) {
return false;
}
if (canplay == 1) {
return false;
}
canplay = 1;
var numby = jQuery( card ).data('card');
var pict = jQuery( card ).find( "img" ).attr("src");
jQuery(card).addClass("selected");
// god I hate making things usable on mobiles
// throw your iphone down the toilet
let poptime = 1500;
let widd = jQuery( document ).width();
if (widd>600) {
poptime = 0;
} else {
jQuery("#zoomarea img").attr("src",pict);
jQuery("#zoomarea").addClass("showpic");
}
setTimeout(function() {
jQuery("#zoomarea").removeClass("showpic");
if (round==0) {
// first card selected
lastans = numby;
round = 1;
jQuery("#instructions").text("Now find an image with the same energy");
canplay = 0;
} else {
if (lastans == numby) {
// MICHAEL WINNER
correct++;
bip.play();
jQuery(".selected").addClass("wonborder");
setTimeout(function() {
jQuery(".selected").addClass("won");
jQuery(".cardarea").removeClass("selected");
document.getElementById('instructions').scrollIntoView({behavior: "smooth"});
canplay = 0;
if (correct==6) {
jQuery("#instructions").text("Game Over");
document.getElementById('endofgame_mistakes_score').innerHTML = mistakes;
document.getElementById('mistakestext').innerHTML = "mistakes";
if (mistakes==0) {
document.getElementById('endofgame_rank_score').innerHTML = "Full Battery";
}
if (mistakes==1) {
document.getElementById('endofgame_rank_score').innerHTML = "Hi-NRG";
document.getElementById('mistakestext').innerHTML = "mistake";
}
if (mistakes==2) {
document.getElementById('endofgame_rank_score').innerHTML = "Caffeine Required";
}
if (mistakes==3) {
document.getElementById('endofgame_rank_score').innerHTML = "One Bar Left";
}
if (mistakes>=4) {
document.getElementById('endofgame_rank_score').innerHTML = "Carpet Static";
}
done.play();
jQuery("body").addClass("gameover");
}
},500);
} else {
mistakes++;
bop.play();
jQuery(".selected").addClass("lose");
jQuery(".cardarea").removeClass("selected");
setTimeout(function() {
jQuery(".cardarea").removeClass("lose");
document.getElementById('instructions').scrollIntoView({behavior: "smooth"});
canplay = 0;
},500);
}
round = 0;
jQuery("#instructions").text("Select an image");
}
},poptime);
}
loadround();
bip = new Howl({
urls: ['ping.mp3'],
autoplay: false,
loop: false,
volume: 1,
onend: function() {
}
});
bop = new Howl({
urls: ['pong.wav'],
autoplay: false,
loop: false,
volume: 0.4,
onend: function() {
}
});
done = new Howl({
urls: ['done.mp3'],
autoplay: false,
loop: false,
volume: 0.7,
onend: function() {
}
});
function twitter() {
var misttext = "mistakes";
if (mistakes==1) {
misttext = "mistake";
}
msg="SAME ENERGY SNAP\n";
msg+="I matched all the images with "+mistakes+" "+misttext+".\n";
var url="https://www.monkeon.co.uk/sameenergysnap/";
var message=encodeURIComponent( msg+""+url);
window.open("https://twitter.com/intent/tweet?text="+message, "", "width=800, height=400");
}
function facebook() {
var misttext = "mistakes";
if (mistakes==1) {
misttext = "mistake";
}
msg="SAME ENERGY SNAP\n";
msg+="I matched all the images with "+mistakes+" "+misttext+".\n";
var url="https://www.monkeon.co.uk/sameenergysnap/";
window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(url)+'"e='+encodeURI(msg),'facebook-share-dialog','width=626,height=436');
}