eBoy pixel art

Posted by phillip Sat, 30 Aug 2008 09:57:00 GMT

click the image to start the storm.

<script type="text/javascript"> //<![CDATA[ var villageImages = ['prestorm-16k-1', 'poststorm-11k', 'reconstructed-05k'].map(function(name) { // too lazy to use regexes ... return 'http://me.phillipoertel.com/files/shp-village-' + name + '-tm.jpg'; }); // preload images villageImages.each(function(url) { (new Image()).src = url; }) Event.observe('eboy-village', 'click', function() { var img = $('eboy-village'); var currentImageNr = villageImages.indexOf(img.src); var newImage = villageImages[currentImageNr + 1] || villageImages[0]; img.src = newImage; }); //]]> </script>

Posted in , | Tags ,