******************************************************************* * Casanova ASCII art game * * (c) by Meph.'99 * *=================================================================* * JAVA Script Copyright: * * based on ... * * - "Method-5 Code" , (c) by cjr and miK * * - "Bewegend ASCII-logo", (c) by miK * * - "SelfHTML" Samples , (c) by Stefan Muenz * *=================================================================* * Note: * * - High score saved as cookie (expires after one day) * * - Uses JAVAScript, DHTML, CSS * * - A Netscape version is possible, but there are some problems: * * o 'OnClick' event didn't work (link tag might work) * * o Writing JAVAScript values with DHTML * * o Font size (px) depends from Win95 display settings * *=================================================================* * Homepage: http://studenten.freepage.de/meph/ascii/eng/eng.htm * ******************************************************************* <style type="text/css"> <!-- input {font-family:Courier New; font-size:18px; background-color:#000000; color:#FFFFFF; border:1px; border-style:solid; border-color:#B0B0B0} form {font-family:Courier New; font-size:18px;} s {text-decoration:none; font-family:Courier New; font-size:22px; } u {text-decoration:none; } #A {color:FF8040}#B {color:FFFF00}#C {color:804040}#D {color:FFFFFF}#E {color:FFFF80} #F {color:808080}#G {color:C0C0C0}#H {color:FF0080}#I {color:FF0000}#J {color:00FF00} #K {color:804000}#L {color:400080}#M {color:0000FF}#N {color:800040}#O {color:FF8080} #P {color:808000}#Q {color:FF8000}#R {color:8080C0}#S {color:00FFFF}#T {color:8080FF} #U {color:008000} //--> </style> <SCRIPT LANGUAGE="JavaScript"><!-- /******* browser config: (c) by cjr and miK ******/ if (document.all) { var doc = 'document.all.layer'; var vis = '.style.visibility'; var pox = '.style.posLeft'; var poy = '.style.posTop';} else { alert ('Sorry, this game works only with IE 4.x or higher.'); if (history.length>1) {history.back()} else {window.close()}} var pic=1; /*Visible picture (Random) */ var pos=1; /*~ASCII building window~ (Random) */ var delay=1400; /*Variable part of the delay value */ var stop=true; /*Stop value (Boolean) */ var punkte=0; /*Hits (Point) */ var girl=0; /*Hits (Girls) */ var boy=0; /*Hits (Boys) */ var no=100; /*Countdown */ var gg=0; /*Total number of girls */ var gb=0; /*Total number of boys */ function ini() { /*Start values*/ document.F0.D0.value=0;document.F0.D1.value=0;document.F0.D1.value=0; pic=1;pos=1;delay=1400;punkte=0;girl=0;boy=0;no=100;gg=0;gb=0; eval(doc+"88"+vis+" = 'hidden'"); eval(doc+"99"+vis+" = 'visible'"); show(); } function rnda(scale) { /*Random*/ var dd=new Date(); return((Math.round(Math.abs(Math.sin(dd.getTime()))*1000000000)%scale)); } function rndb(scale) { /*Random*/ var dd=new Date(); return((Math.round(Math.abs(Math.cos(dd.getTime()))*1000000000)%scale)); } function show(){ /*Main display routine*/ delay=(delay/1.15);no=no-1;document.F0.D3.value=no; if (no==0) {stop=true}; eval(doc+pic+pox+" = 0");eval(doc+pic+poy+" = 100");eval(doc+pic+vis+" = 'hidden'"); pic=Math.round(rnda(9)+1); pos=Math.round(rndb(9)+1); if (pic<5) {gg=gg+1} else {gb=gb+1}; if (pos==1) {eval(doc+pic+pox+" = 75");eval(doc+pic+poy+" = 215")} else if (pos==2) {eval(doc+pic+pox+" = 210");eval(doc+pic+poy+" = 215")} else if (pos==3) {eval(doc+pic+pox+" = 330");eval(doc+pic+poy+" = 215")} else if (pos==4) {eval(doc+pic+pox+" = 450");eval(doc+pic+poy+" = 215")} else if (pos==5) {eval(doc+pic+pox+" = 585");eval(doc+pic+poy+" = 215")} else if (pos==6) {eval(doc+pic+pox+" = 75"); eval(doc+pic+poy+" = 305")} else if (pos==7) {eval(doc+pic+pox+" = 210");eval(doc+pic+poy+" = 305")} else if (pos==8) {eval(doc+pic+pox+" = 450");eval(doc+pic+poy+" = 305")} else if (pos==9) {eval(doc+pic+pox+" = 585");eval(doc+pic+poy+" = 305")} eval(doc+pic+vis+" = 'visible'"); if (stop==false) {setTimeout("show()",600+delay)} else {eval(doc+pic+pox+" = 0");eval(doc+pic+poy+" = 100");eval(doc+pic+vis+" = 'hidden'"); if (no==0){stat()}}; } function hit(i){ /*Count hits*/ punkte=punkte+i; if (i==1) {girl=girl+1} else if (i==-1) {boy=boy+1}; document.F0.D0.value=punkte; document.F0.D1.value=girl; document.F0.D2.value=boy; } function WertSetzen(eing) /*Write cookie highscore*/ { var jetzt = new Date(); eing="ASCIIGame=?"+eing; var Auszeit = new Date(jetzt.getTime() + (1000*60*60*24)); document.cookie = eing+"; expires="+Auszeit.toGMTString()+";";} function WertHolen() /*Read cookie highscore*/ { var Wert = "keiner"; if(document.cookie) { Wertstart = document.cookie.indexOf("?") + 1; Wertende = document.cookie.indexOf(";"); if(Wertende == -1) Wertende = document.cookie.length; Wert = document.cookie.substring(Wertstart,Wertende); } return Wert; } function stat(){ /*Write statistic, high score ...*/ document.F0.D0.value=0; document.F0.D1.value=0; document.F0.D2.value=0; eval(doc+"99"+vis+" = 'hidden'"); document.write('<center><b style="font-size:50px; color:#0000F0">G A M E - O V E R !</b></center><hr>'); document.write('<p style="color:#FFFFFF; font-family:Courier New; font-size:22px; background-color:#500202">-&gt; Point : '+punkte+'<br>'); document.write('-&gt; '+girl+' roses to '+gg+' girls<br>'); document.write('-&gt; '+boy+' roses to '+gb+' boys<br></p><br><br>'); document.write('<center><b style="font-size:30px; color:#FFFFFF">High Score</b>'); document.write('<table bgColor="#FFFFFF" width="90%" style="font-family: Courier New; font-size: 18px" bordercolor="#000000" border="1">'); document.write('<tr><td align="center"><b>Position:</b></td><td align="center"><b>Point:</b></td><td align="center"><b>Date:</b></td></tr>'); score=WertHolen();var jetzt = new Date();xt=0; if (score=="keiner") { document.write('<tr><td align="center">1</td><td align="center">'+punkte+'</td><td align="center">'+jetzt.toGMTString()+'</td></tr>'); jetzt=punkte+'='+jetzt.toGMTString()+String.fromCharCode(13); WertSetzen(jetzt); } else { liste = score.split(String.fromCharCode(13)); var pp=new Array(); var tt=new Array(); for (var i=0; i<liste.length-1; i++) { /*Read Cookie*/ Wertstart = liste[i].indexOf("=") + 1; pp[i] = liste[i].substring(0,Wertstart-1); tt[i] = liste[i].substring(Wertstart,liste[i].length); } pp[liste.length-1] = punkte; tt[liste.length-1] = jetzt.toGMTString(); for (var i=1; i<liste.length+1; i++) { /* Bubble Sort*/ xt=i; while (Math.round(pp[xt])>Math.round(pp[xt-1])) { tempp=tt[xt-1];tt[xt-1]=tt[xt];tt[xt]=tempp; temp=pp[xt-1];pp[xt-1]=pp[xt];pp[xt]=temp; xt=xt-1; } }; tempp="";xt=0; if (liste.length>5) {temp=5} else {temp=liste.length}; for (var i=0; i<temp; i++) { /*Write table*/ tempp=tempp+pp[i]+'='+tt[i]+String.fromCharCode(13); if (tt[i]==jetzt.toGMTString()) { xt=1; document.write('<tr><td align="center" bgcolor="#C0C0C0"><blink>'+Math.round(i+1)+'</blink></td><td align="center" bgcolor="#C0C0C0"><blink>'+pp[i]+'</blink></td>'); document.write('<td align="center" bgcolor="#C0C0C0"><blink>'+tt[i]+'</blink></td></tr>');} else { document.write('<tr><td align="center">'+Math.round(i+1)+'</td><td align="center">'+pp[i]+'</td><td align="center">'+tt[i]+'</td></tr>');}} WertSetzen(tempp); } document.write('</table>'); if (xt==1){document.write('<b style="font-size:20px"><font color="#C0C0C0"><blink>New Highscore !</blink></font></b></center>');}; document.write('<br><br>'); document.write('<center><b style="font-size:40px; color:#FF0000">'); if (punkte<0) {document.write('Hmm - Do you like girls or boys ?')} else if (punkte/gg<0.5 || punkte==0) {document.write('L o o o o s e r ! ! !')} else if (punkte/gg==0.5) {document.write('Only medium :(')} else if (punkte/gg<0.8) {document.write('Good work, Casanova.')} else if (punkte/gg==1) {document.write('Cheater !')} else if (punkte/gg>0.8) {document.write('You are the dream of all woman !')} document.write(' <br></b><b style="font-size:20px"><a href="javascript:history.back()">Restart</a></b>'); document.bgColor ="#000000"; } // --></SCRIPT> <BODY TEXT="#800000" BGCOLOR="#000000" ONRESIZE="DOCUMENT.BGCOLOR ='#000000'" ONLOAD="DOCUMENT.BGCOLOR ='#000000'"> <FORM NAME="F0"><u id="D"> <INPUT TYPE=BUTTON NAME="B0" VALUE="Start" onClick="stop=false; ini()"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POINT: <INPUT TYPE=TEXT NAME="D0" READONLY VALUE="0" SIZE="4"> GIRLS: <INPUT TYPE=TEXT NAME="D1" READONLY VALUE="0" SIZE="4"> BOYS: <INPUT TYPE=TEXT NAME="D2" READONLY VALUE="0" SIZE="4"> COUNTDOWN: <INPUT TYPE=TEXT NAME="D3" READONLY VALUE="0" SIZE="4"> </u></FORM> <DIV ID="layer88" STYLE="position:absolute; top:80; left:0; width:100%; visibility:visible"> <s> <center><p style="color:#FF0000; font-weight: bold; font-size:30px; width:90%; background-color:#500202"> The "CASANOVA" ASCII Game ! </p></center> <pre><font color="#0000FF"><br><br> Greetings to cjr and mik (Who the f*** is miK ?) [Copyright, see source code] </font><font color="#FFFFFF">The Rules: You are standing before a big house with many windows. If you see a girl at a window ( golden hair and red lips :) threw a rose in her room ( click on the girl). Good luck, Casanova</font> </pre> <center>Press the 'Start' button.</center> </s> </DIV> <span style="font-family: Courier New; font-size: 8px; color:#FF8000"> <DIV ID="layer99" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE><u id="I"> __/\__ __/\__ ___/ ____ \___ ___/ ____ \___ __/ ___/__(_\___ \__ __/ ___/__(_\___ \__ __/ __/_)__)__)__)_\__ \__ __/ __/_)__)__)__)_\__ \__ __/ __/(__(__(__(__(__(__\__ \__ __/ __/(__(__(__(__(__(__\__ \__ __/ __/_)__)__)__)__)__)__)__)_\__ \__ __/ __/_)__)__)__)__)__)__)__)_\__ \__ ___/ __/(__(__(__(__(__(__(__(__(__(__\__ \___ ___/ __/(__(__(__(__(__(__(__(__(__(__\__ \___ __/ ___/_)__)__)__)__)__)__)__)__)__)__)__)_\___ \__ __/ ___/_)__)__)__)__)__)__)__)__)__)__)__)_\___ \__ __/ __/_(__(__(__(__(__(__(__(__(__(__(__(__(__(__(\___\_____________________/___/_(__(__(__(__(__(__(__(__(__(__(__(__(__(__(\__ \__ _/ __/__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__)__\__ \_ (__/_(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(__(\__)</u> <u id="C">||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|| ||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|| ||XXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXXXXXXX<u id="B">###############</u>XXXXXXXXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXXXXXXX<u id="B">###############</u>XXXXXXXXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXX|| ||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|| ||XXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="P">#######</u>XXXXXXXXXXXXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXXX<u id="P">###===#===###</u>XXXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXXX<u id="P">#======#======#</u>XXXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXXX<u id="P">#=======#=======#</u>XXXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXXX<u id="P">#========#========#</u>XXXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXX<u id="P">#=========#=========#</u>XXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXX<u id="P">#=========#=========#</u>XXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXX<u id="P">#=========#=========#</u>XXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXXXX<u id="P">#=====###=#=###=====#</u>XXXXXXX<u id="B"># #</u>XXXXXXXXXXXXX<u id="B"># #</u>XXXX|| ||XXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXXXX<u id="P">#=====#===#===#=====#</u>XXXXXXX<u id="B">##############</u>XXXXXXXXXXXXX<u id="B">##############</u>XXXX|| ||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<u id="P">#=========#=========#</u>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|| ||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<u id="P">#=========#=========#</u>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|| ||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<u id="P">#=========#=========#</u>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX||</u> <u id="A">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</u> </PRE></DIV> <DIV ID="layer0" onMouseDown="hit(1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="B">~~~~~~~ ~</u>/ @ @ \<u id="B">~ ~</u>x <u id="G">L </u>x<u id="B">~ ~ </u>\ <u id="H">-=- </u>/ <u id="B">~ </u>''-'' <u id="I">__/ \__ / jgs \ / \</u> </PRE></DIV> <DIV ID="layer1" onMouseDown="hit(1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="B"> ~~~~~~~ ~</u>/ <u id="D">o o </u>\<u id="B">~ ~</u>p i q<u id="B">~ ~ </u>\ <u id="H">--- </u>/ <u id="B">~ </u>''-'' <u id="T">__/ \__ / Pam \ / \</u> </PRE></DIV> <DIV ID="layer2" onMouseDown="hit(1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="B">~~~~~~~ ~</u>/ 0 0 \<u id="B">~ ~</u>x <u id="G">L </u>x<u id="B">~ ~ </u>\ <u id="H">-=- </u>/ <u id="B">~ </u>''-'' <u id="I">__/ \__ / \ / \</u> </PRE></DIV> <DIV ID="layer3" onMouseDown="hit(1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="B">~~~~~ ~~~~~~~~~ ~~</u>/ <u id="J">o o </u>\<u id="B">~~ ~</u>o ! o<u id="B">~ ~ </u>\ <u id="I">--- </u>/ <u id="B">~ ~ </u>''-'' <u id="B">~ </u><u id="B">~ </u><u id="L">__/ \__ </u><u id="B">~ </u><u id="L">/ \</u> </PRE></DIV> <DIV ID="layer4" onMouseDown="hit(1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="B">,|||||||. ||</u><u id="E">. .</u><u id="B">|| |||</u> ^ <u id="B">||| |||</u>\ <u id="I">=</u> /<u id="B">|||</u> .---`-'---. ( . ) ( . ) `-' `-' / VK \ </PRE></DIV> <DIV ID="layer5" onMouseDown="hit(-1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="C">||||| </u>I <u id="G">0 0 </u>I ! <u id="Q">i </u>! I <u id="D">--- </u>I !!!!! <u id="R">_/ \_ / Joe \ / \</u> </PRE></DIV> <DIV ID="layer6" onMouseDown="hit(-1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="O">***** </u>/ <u id="F">O O </u>\ ! <u id="D">i </u>! \ <u id="D">- </u>/ ~~-~~ <u id="P">__/ \__ / miK \ / \</u> </PRE></DIV> <DIV ID="layer7" onMouseDown="hit(-1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="N">##### </u>/ <u id="C">= = </u>\ N ! N \ <u id="K">~^~ </u>/ ~~-~~ <u id="F">__/ \__ / Lester\ / \</u> </PRE></DIV> <DIV ID="layer8" onMouseDown="hit(-1)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="K">xxxxx </u>/ Q Q \ o <u id="I">' </u>o \ - / -===- <u id="B">__/ \__ / cjr \ / \</u> </PRE></DIV> <DIV ID="layer9" onMouseDown="hit(-10)" STYLE="position:absolute; top:100; left:0; visibility:hidden"><PRE> <u id="I">Meph. /\ /\ ( (__) ) \<u id="D">@</u>..<u id="D">@</u>/ __\()/__ / \/ \ | ( . . ) | | | | |</u> </PRE></DIV> </span> </body> </html>