Skip to content

Instantly share code, notes, and snippets.

@adellhk
Created August 29, 2015 06:39
Show Gist options
  • Save adellhk/0cb711749c6b33168a9c to your computer and use it in GitHub Desktop.
Save adellhk/0cb711749c6b33168a9c to your computer and use it in GitHub Desktop.
$(document).ready(function() {
bindStart(); //assumes you have an element, could be a div or button or whatever, with an id of 'start'
bindRGBYButtons();
});
function bindStart() {
$('#start').on('click', function() {
startGame();
});
};
function bindRGBYButtons() {
$('#R, #G, #B, #Y').on('click', function() {
event.preventDefault();
console.log(this.id); //you can pass the ID of the div clicked on to another function such as: playerSelect(this.id);
});
};
function startGame() {
// your game logic here, such as displayInstructions(), displayCombination()
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment