Created
August 29, 2015 06:39
-
-
Save adellhk/0cb711749c6b33168a9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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