Tetris is an interesting game that also make your brain more
work.Undoubtedly one of the best, fully functional DHTML tetris
game we've seen. Add it to your site, and provide your visitors
(not to mention yourself!) with a constant stream of fun!
Step 1: Insert the following into the <BODY>
section of your page:
<script>
/*
Tetris
*/
//preload images routine by www.kristamitra.com
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("block0.gif","block1.gif","block2.gif","block3.gif",
"block4.gif","block5.gif","block6.gif","blockb.gif")
function goTetris() {
if (document.layers) {
window.open("tetrisNN.html", "Tetris", "width=360,height=400,resizable,titlebar=1");
}
else if (document.all) {
window.open("tetrisIE.html", "Tetris", "width=360,height=400,resizable,titlebar=1");
}
else {
alert("Anda butuh IE 4+ or NS 4 untuk bermain Tetris!");
}
}
</script>
<a href="tetris.htm" onClick="goTetris();return false">Main Tetris!</a>
Step
2:
Download the following file, and extract its contents
into your webpage directory, where the above page resides. It
contains the relevant images, plus two html pages that make up the
game itself:
Tetris.zip
Finally,Extract that files into your website directory and enjoy.
|