Skip to content

Instantly share code, notes, and snippets.

@dan-mi-sun
Created May 19, 2014 18:53
Show Gist options
  • Save dan-mi-sun/78d253a5c67c6463a4cb to your computer and use it in GitHub Desktop.
Save dan-mi-sun/78d253a5c67c6463a4cb to your computer and use it in GitHub Desktop.
$(document).ready(function() {
console.log("Welcome to Duck Hunt!");
// Behaviour for the play again link
$('#play-again').click(function(e) {
$("#game-over").toggle();
new Game();
});
// Moves the crosshair with the mousepointer
// TODO: Add a mousemove event to the #game element...
$("#game").mousemove(function(event) {
$("#crosshair").css({"display": "block", "left": (event.pageX-30), "top": (event.pageY-30)});
});
// Kick-off a New Game
new Game();
// TODO: Pass in a string to represent the difficulty level
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment