Hallo zusammen! Ich bekomme es einfach nicht hin!!! Füge die ganze Seite jetzt einfach hier rein, vielleicht ist ja jemand (vielleicht Struppi?) so nett, und kann mir ganz plakativ (vielleicht in der Zeile ... ergänzen?) weiterhelfen? Das onLoad="init();" für das "Memory" im <body> fehlt im Moment, weil ich ja nicht weiß wohin und wie, so dass das Spiel auch funktioniert. Besten Dank im Voraus!
<html><head>
<script language="JavaScript">
var noi = 32; var prefix = "i"; var endung = ".gif"; var deckblatt = "logo.jpg" var is = new Array(noi/2); var f = new Array(noi); visible = -1; pos = -1; pos2 = -1; cs = 0;
win = new Array(noi/2); moves = 0; schum = 0; pair = true;
function init () {
load_images(); init_game();
}
function load_images() {
for (n=0;n<(noi/2);n++) { is[n] = new Image(); is[n].src = prefix + n + endung; } }
function init_game() {
moves = 0; pair = true; visible = -1; pos = -1; pos2 = -1; cs = 0; win = new Array(noi/2);
for (i=0;i<(noi/2);i++) { win[i] = false; }
for (k=0;k<noi;k++) { document.images[k].src = deckblatt;
}
for (j=0;j<noi;j++) { f[j] = -1;
}
for (m=0;m<noi;m++)
spos = 0; steps = 0; p = zufall(noi); while (p>steps) {
spos++;
if (spos==noi) { //Turn-around
spos = spos - noi;
}
if (f[spos] == -1) {
steps++;
}
}
f[spos] = m;
}
for (m=0;m<noi;m++) f[m] = f[m] % (noi/2);
} }
function zufall(n) {
return Math.ceil(Math.random()*(n-1));
} }
function bestimmen(i){
aussuchen (i); if (document.images[i].src != is[(f[i])].src){ document.images[i].src = is[(f[i])].src; aussuchen (i); document.images[i].src = deckblatt;
} }
function aussuchen(i) {
if (document.images[i].src == is[0].src){ win.document.write("<img src='i0.gif'></td>");
}
if (document.images[i].src == is[1].src){ win.document.write("<img src='i1.gif'></td>");
}
... }
if (document.images[i].src == is[15].src){ win.document.write("<img src='i15.gif'></td>");
} }
var win=window.open("","","height=570,width=950,left=30,top=50"); win.document.open("text/html"); win.document.write("<HTML><HEAD><TITLE>Gedächtnisspiel</TITLE></HEAD>"); win.document.write("<BODY onclick='self.close()' onblur='self.close()'>");
win.document.write("<table><tr><td width='75'> </td><td width='900'>"); win.document.write("<p align='center'><br><b><font size='4'></font></b></p></td>"); win.document.write("<td width='75'> </td></tr><tr><td> </td><td> </td>"); win.document.write("<td> </td></tr></table>");
win.document.write("<div align='center'>");
win.document.write("<table border='0' cellpadding='0' cellspacing='0'>");
win.document.write("<tr>");
win.document.write("<td style='width:84px; height:84px'>"); bestimmen (00);
win.document.write("<td style='width:84px; height:84px'>"); bestimmen (01);
... win.document.write("<td style='width:84px; height:84px'>");bestimmen (07);
win.document.write("</tr>");
win.document.write("<tr>");
win.document.write("<td style='width:84px; height:84px'>");bestimmen (08);
...
win.document.write("<td style='width:84px; height:84px'); bestimmen (15);
win.document.write("</tr>");
win.document.write("<tr>");
win.document.write("<td style='width:84px; height:84px'>"); bestimmen (16);
... win.document.write("<td style='width:84px; height:84px'>"); bestimmen (31);
win.document.write("</tr>");
win.document.write("</table>");
win.document.write("</div>");
win.document.write("</BODY></HTML>");
win.document.close();
} } }
else {
if ((i != pos2) && (i != pos)) {
document.images[i].src = is[(f[i])].src; moves++; pos2 = i; cs = 0; pair = false;
if (f[i] == visible) {
win[visible] = true; goal = true; pair = true; for (n=0;n<noi/2;n++) {
if (win[n] == false) {
goal = false;
} }
if (goal == true) { alert("Geschafft! \n\nSie haben " + moves + "-mal geraten."); } } else { } } } } }
// -->
</script>
</head>
<body bgcolor="FDF6E4" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" onLoad="MM_preloadImages('a.gif','b.gif','c.gif','d.gif','e.gif','f.gif','g.gif','h.gif','j.gif','k.gif')">
<div align="left">
<table> <tr> <td colspan="6"><img src="a.gif" width="800" height="96"></td> </tr> <tr>
<td valign="top" width="133"><a href="x1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','b.gif',1)"><img src="Bilder/design_neu_3_image_ready_03.gif"name="Image1"></a><br> <a href="x2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','bilder_mp/design_neu_3_image_ready_05.gif',1)"><img src="Bilder/design_neu_3_image_ready_05.gif"name="Image2"></a><br> <a href="x3.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','bilder_mp/design_neu_3_image_ready_06.gif',1)"><img src="Bilder/design_neu_3_image_ready_06.gif" name="Image3"></a><br> <a href="x4.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','bilder_mp/design_neu_3_image_ready_07.gif',1)"><img src="Bilder/design_neu_3_image_ready_07.gif" name="Image4"></a><br> <a href="x5.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','bilder_mp/design_neu_3_image_ready_08.gif',1)"><img src="Bilder/design_neu_3_image_ready_08.gif" name="Image5"></a><br> <a href="x6.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','bilder_mp/design_neu_3_image_ready_09.gif',1)"><img src="Bilder/design_neu_3_image_ready_09.gif" name="Image6"></a><br> <a href="x7.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','bilder_mp/design_neu_3_image_ready_10.gif',1)"><img src="Bilder/design_neu_3_image_ready_10.gif" width="130" height="27" border="0" name="Image7"></a><br> <a href="x8.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','bilder_mp/design_neu_3_image_ready_11.gif',1)"><img src="Bilder/design_neu_3_image_ready_11.gif" name="Image8"></a><br> <a href="x9.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','bilder_mp/design_neu_3_image_ready_12.gif',1)"><img src="Bilder/design_neu_3_image_ready_12.gif" name="Image9"></a><br> <a href="x10.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','bilder_mp/design_neu_3_image_ready_13.gif',1)"><img src="Bilder/design_neu_3_image_ready_13.gif" name="Image10"></a> </td>
<td width="950"> <p><font face="Arial, Helvetica, sans-serif" size="2" color="#666666"><b><img src="spacer20d.gif" width="316" height="28"><br> Gedächnisspiel</p>
<table width="65%" border="0" cellspacing="3" cellpadding="1" height="692">
<tr> <td><font face="Arial, Helvetica, sans-serif"><b>Spiel mal wieder...</b></font></td> <td width="34%"> </td> </tr> <tr> <td colspan="2" height="132"> <p>Text</p>
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="700"> <tr> <td align="center" colspan="8"> </td> </tr> <tr> <td height="84" width="84" align="center"><a href="javascript:aufdecken(00)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(01)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(02)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(03)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(04)"> <img src="logo.jpg"></a> </td> <td ><a href="javascript:aufdecken(05)"> <img src="logo.jpg" ></a> </td> <td ><a href="javascript:aufdecken(06)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(07)"> <img src="logo.jpg"></a> </td> </tr>
<tr> <td ><a href="javascript:aufdecken(08)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(09)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(10)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(11)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(12)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(13)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(14)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(15)"> <img src="logo.jpg"></a> </td> </tr> <tr> <td><a href="javascript:aufdecken(16)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(17)"> <img src="logo.jpg"></a> </td> <td height="84" width="84" align="center"><a href="javascript:aufdecken(18)"> <img src="logo.jpg" border="0" align="bottom" width="83" height="83"></a> </td> <td><a href="javascript:aufdecken(19)"> <img src="logo.jpg"></a> </td> <td height="84" width="84" align="center"><a href="javascript:aufdecken(20)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(21)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(22)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(23)"> <img src="logo.jpg"></a> </td> </tr> <tr> <td><a href="javascript:aufdecken(24)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(25)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(26)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(27)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(28)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(29)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(30)"> <img src="logo.jpg"></a> </td> <td><a href="javascript:aufdecken(31)"> <img src="logo.jpg"></a> </td> </tr>
</table> </td> </tr>
<tr> <td colspan="2"> <div align="left"></div> </td> </tr>
</table>
</table></div>
</body>