Skip to content

Instantly share code, notes, and snippets.

@aussielunix
Forked from mikel/asteroids.js
Created April 26, 2011 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aussielunix/941580 to your computer and use it in GitHub Desktop.
Save aussielunix/941580 to your computer and use it in GitHub Desktop.
// Fires up Asteroids through pressing Ctrl-A
//
var isCtrl = false;
$(document).keyup(function (e) {
if(e.which == 17) isCtrl=false;
}).keydown(function (e) {
if(e.which == 17) isCtrl=true;
if(e.which == 65 && isCtrl == true) {
if($('script#Asteroids').size()==0){
var s = document.createElement('script');s.type='text/javascript';
$(s).attr('id', 'Asteroids');
document.body.appendChild(s);
s.src='http://erkie.github.com/asteroids.min.js';
return false;
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment