8

Is it possible to destroy EVERYTHING on a given page when playing the game from http://erkie.github.com?

  • 1
    That bookmarklet would be very fitting as an easter egg on this site. – Senseful Oct 7 '10 at 21:26
4

No, it's not always possible. Usually some items stick around with a 0×0 hitbox thus preventing you from bringing the page down to the bare background.

You'll know you've gone as far as you can when holding the B button shows no blinking targets.

One such site, for example, is the (classic) Twitter profile page.

| improve this answer | |
6

Taken from the source code:

var ignoredTypes = ['HTML', 'HEAD', 'BODY', 'SCRIPT', 'TITLE', 'META', 'STYLE', 'LINK', 'SHAPE', 'LINE', 'GROUP', 'IMAGE', 'STROKE', 'FILL', 'SKEW', 'PATH', 'TEXTPATH']; // Half of these are for IE g_vml
var hiddenTypes = ['BR', 'HR'];

...

// elements with className ASTEROIDSYEAH are part of the "game"
if ( indexOf(ignoredTypes, el.tagName.toUpperCase()) == -1 && el.prefix != 'g_vml_' && hasOnlyTextualChildren(el) && el.className != "ASTEROIDSYEAH" && el.offsetHeight > 0 ) {

...
function indexOf(arr, item, from){
    if ( arr.indexOf ) return arr.indexOf(item, from);
    var len = arr.length;
    for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){
        if (arr[i] === item) return i;
    }
    return -1;
};

Thus ignoredTypes are not valid enemies

| improve this answer | |
  • Aha. So you could make up some tag that it doesn't ignore that supersets script and use that as a switch for erkie, the game – Ritwik Bose Oct 5 '10 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.