|
|
Voir le sujet précédent :: Voir le sujet suivant |
Auteur |
Message |
Arthur dreamweaver mioche
|
jeux , Posté le: 07-04-2006 12:41 |
|
|
Salut à tous sur mon site je voudrait intégrer des jeux de ma creation(pas en java)
merci |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 07-04-2006 18:49 |
|
|
tape sa et surprise
Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>JS-DHTML-Tetris</title>
<meta name="Title" lang="fr" content="jeu de TETRIS">
<meta name="Keywords" lang="fr" content="javascript jeu tetris dhtml ghislain lavoie">
<meta name="Author" lang="fr" content="Ghislain Lavoie">
<!--
-->
<STYLE type="text/css">
body {background-color:#d2d2d2;color:#000000;font-family:tahoma;}
input {background-color:#e6e6e6;width:120px;}
.caseTB {background-color:#8f8f8f;border:1px #f8cc8b inset;width:15px;height:15px;font-size:5px;}
.inpText {background-color:#9f9f9f;width:70px;border:0px;border-bottom:1px black solid;text-align:right;}
#aide {width:430px;height:400px;background-color:#d2d2d2;overflow:auto;font-family:arial;font-size:14px;position:absolute;display:none;}
p {margin:5px;}
p.para {text-align:justify;text-justify:auto;}
p.para:first-letter {font-weight:bold;}
</STYLE>
<script type="text/javascript">
var ok = null;
var formCour = null;
var formNext = null;
var cases = new Array();
var formes = new Array();
var niveau = 1;
var point = 0;
var ligne = 0;
var pause = false;
var fin = true;
var coulForme = new Array("#81e7f5","#0eb16c","#404fff","#fcd836","#c681f5","#7ffd29","#ff0000");
formes[0] = new Array(-1,0,-1,1,0,1,0,2,-2,1,-1,1,-1,0,0,0,-1,0,-1,1,0,1,0,2,-2,1,-1,1,-1,0,0,0);
formes[1] = new Array(0,0,0,1,-1,1,-1,2,-2,0,-1,0,-1,1,0,1,0,0,0,1,-1,1,-1,2,-2,0,-1,0,-1,1,0,1);
formes[2] = new Array(-1,1,-1,2,0,1,0,2,-1,1,-1,2,0,1,0,2,-1,1,-1,2,0,1,0,2,-1,1,-1,2,0,1,0,2);
formes[3] = new Array(0,2,0,1,0,0,-1,0,0,1,-1,1,-2,1,-2,2,-1,0,-1,1,-1,2,0,2,-2,1,-1,1,0,1,0,0);
formes[4] = new Array(0,0,0,1,0,2,-1,2,-2,1,-1,1,0,1,0,2,-1,2,-1,1,-1,0,0,0,0,1,-1,1,-2,1,-2,0);
formes[5] = new Array(0,0,0,1,0,2,0,3,-3,1,-2,1,-1,1,0,1,0,0,0,1,0,2,0,3,-3,1,-2,1,-1,1,0,1);
formes[6] = new Array(-1,0,-1,1,-1,2,0,1,-2,1,-1,1,0,1,-1,0,0,2,0,1,0,0,-1,1,0,0,-1,0,-2,0,-1,1);
var tailleCase = 15;
var nbCaseX = 12;
var nbCaseY = 22;
var taille = tailleCase + (document.all?0:-2);
var rebord = (document.all)?0:2;
var posx,posy;
var formCour, formSuiv;
function cube(y,x,py,px,coul)
{
this.el = document.createElement("div");
this.el.style.position = "absolute";
this.el.style.top = ((taille+rebord)*(y+py))+"px";
this.el.style.left = ((taille+rebord)*(x+px))+"px";
this.el.style.display = (y+py>=0)?"block":"none";
this.el.style.width = taille+"px";
this.el.style.height = taille+"px";
this.el.style.backgroundColor = coul;
this.el.style.border="1px black solid";
this.el.style.fontSize = "0px";
}
function forme(no,py,px,leDiv)
{
var i,j;
this.cubes = new Array();
this.rotation = 0;
this.no = no;
for (i =0, j=0;i<8;i = i+2,j++)
{
this.cubes[j] = new cube(formes[no][i],formes[no][i+1],py,px,coulForme[no])
leDiv.appendChild(this.cubes[j].el);
}
}
function deplacerForme(nbY, nbX, plusRotation,py,px)
{
var i,j,x,y,rotation;
rotation = (formCour.rotation + plusRotation);
rotation = rotation<0?3:rotation>3?0:rotation;
for (i =rotation*8,j=0;i<(rotation*8)+8;i = i+2,j++)
{
y = formes[formCour.no][i] + py + nbY;
x = formes[formCour.no][i+1] + px + nbX;
if (x==-1 || y==nbCaseY || x==nbCaseX || (cases[y] && cases[y][x]!=null)) return false;
}
formCour.rotation = rotation;
py = py + nbY;
px = px + nbX;
for (i =rotation*8,j=0;i<(rotation*8)+8;i = i+2,j++)
{
y = (formes[formCour.no][i] + py);
formCour.cubes[j].el.style.display = (y>=0)?"block":"none";
formCour.cubes[j].el.style.top = ((taille+rebord) * y)+"px";
formCour.cubes[j].el.style.left = ((taille+rebord) * (formes[formCour.no][i+1] + px))+"px";
}
return true;
}
function initialiserJeux()
{
var tbl,tb,cols,rows,row,col;
bord = document.getElementById("jeux");
prochain = document.getElementById("next");
bord.style.width = tailleCase * nbCaseX;
bord.style.height = tailleCase * nbCaseY;
bord.style.backgroundColor = "#8f8f8f";
tbl = document.createElement("table");
tb= document.createElement("tbody");
tbl.appendChild(tb);
tbl.cellSpacing="0";
tbl.cellPadding="0";
tbl.width = tailleCase * nbCaseX;
tbl.height = tailleCase * nbCaseY;
for (rows=0;rows<nbCaseY;rows++)
{
row = document.createElement("TR");
for (cols=0;cols<nbCaseX;cols++)
{
col = document.createElement("td");
col.className="caseTB";
col.innerHTML="&";
row.appendChild(col);
}
tbl.lastChild.appendChild(row);
}
bord.appendChild(tbl);
document.key.down.focus();
document.key.down.onkeydown = verifierActionJoueur;
}
function nouvellePartie()
{
var i;
initCases();
if (formCour && !fin)
{
for (i=0; i<4;i++)
bord.removeChild(formCour.cubes[i].el);
}
posx = ((nbCaseX / 2)-2);
posy = -1;
vitesse = 650;
niveau = 1;
point = 0;
ligne = 0;
fin = false;
formNext =new forme( Math.floor(Math.random()*formes.length),1,0,prochain);
formCour =new forme( Math.floor(Math.random()*formes.length),posy,posx,bord);
pts = setInterval("majPointage()",1000);
setTimeout("partieEnCour()",vitesse);
}
function partieEnCour()
{
var x,y,i,cols;
if (!deplacerForme(1,0,0,posy,posx))
{
point = point + niveau;
var Y = new Array();
for (i =formCour.rotation*8,j=0;i<(formCour.rotation*8)+8;i = i+2,j++)
{
prochain.removeChild(formNext.cubes[j].el);
y = formes[formCour.no][i] + posy;
Y[Y.length] = y;
x = formes[formCour.no][i+1] + posx;
if (y>=0)
{
cases[y][x] = formCour.cubes[j].el;
}
}
Y.sort();
for (i=0;i<Y.length;i++)
{
if (i==0 || ( i>0 && Y[i]!=Y[i-1]))
{
for (cols=0;cols<nbCaseX;cols++)
if (cases[Y[i]] && cases[Y[i]][cols]==null) break;
if (cols==nbCaseX) enleverLignePleine(Y[i]);
}
}
if (posy==-1)
{
fin = true;
clearTimeout(ok);
clearInterval(pts);
majPointage();
document.main.start.value = "COMMENCER";
alert("Partie Terminée!!!");
return;
}
posx = ((nbCaseX / 2)-2);
posy = -1;
formCour = new forme(formNext.no,posy,posx,bord);
formNext = new forme( Math.floor(Math.random()*formes.length),1,0,prochain);
}
else
{
posy++;
}
ok = setTimeout("partieEnCour()",vitesse);
}
function enleverLignePleine(y)
{
ligne++;
point = point + 100;
niveau = Math.floor(ligne/5)+1;
vitesse = 700 - (niveau * 65)
var rows,cols;
for (rows=y;rows>=0;rows--)
for (cols=0;cols<nbCaseX;cols++)
{
if (rows!=y)
{
if (cases[rows][cols]!=null)
cases[rows][cols].style.top = (cases[rows][cols].offsetTop + taille + rebord)+"px";
cases[rows+1][cols] = cases[rows][cols];
cases[rows][cols]= null;
}
else
bord.removeChild(cases[rows][cols]);
}
}
function initCases()
{
var rows,cols;
for (rows=0;rows<nbCaseY;rows++)
{
if (!cases[rows]) cases[rows] = new Array();
for (cols=0;cols<nbCaseX;cols++)
{
if (cases[rows][cols])
bord.removeChild(cases[rows][cols]);
cases[rows][cols] = null;
}
}
}
function verifierActionJoueur(ev)
{
if (pause) return;
var keyPress = document.all?event.keyCode:ev.which;
if (keyPress == 37)
if (deplacerForme(0,-1,0,posy,posx)) posx--;
if (keyPress == 39)
if(deplacerForme(0,1,0,posy,posx)) posx++;
if (keyPress == 38) deplacerForme(0,0,-1,posy,posx)
if (keyPress == 40) deplacerForme(0,0,1,posy,posx)
if (keyPress == 32) {while(deplacerForme(1,0,0,posy,posx)){posy++;point = point + niveau;}}
}
function majPointage()
{
document.main.points.value = point;
document.main.niveaux.value = niveau;
document.main.lignes.value = ligne;
}
function topElement(e)
{
return ((e && topElement != topElement.caller)?e.offsetTop:0) + ((e && e.offsetParent)?e.offsetParent.offsetTop + topElement(e.offsetParent):0);
}
function leftElement(e)
{
return ((e && leftElement != leftElement.caller)?e.offsetLeft:0) + ((e && e.offsetParent)?e.offsetParent.offsetLeft + leftElement(e.offsetParent):0);
}
function help()
{
var h = document.getElementById("aide");
var j = document.getElementById("posJeux");
h.style.top = topElement(j)
h.style.left = leftElement(j)
if (!pause && !fin) document.main.start.onclick();
h.style.display = "block"
}
</script>
</head>
<body onload="initialiserJeux()" onclick="document.key.down.focus();">
<table width="100%" height="100%" border="0" bgcolor="#d2d2d2">
<tr><td align="center" valign="middle">
<table id="posJeux" style="border:6px #8f8f8f groove;" width="430" height="400" border="0" cellpadding="0" cellspacing="0" bgcolor="#e6e6e6">
<tr>
<td width="55%" align="center">
<div style="position:relative;">
<div style="position:relative;" id="jeux"></div></div></td>
<td width="45%" align="center" bgcolor="#9f9f9f"><span style="font-size:22px;font-weight:bold;">TETRIS</span></br></br>
<table border="0" height="30px" bgcolor="#8f8f8f">
<tr><td height="30px;" align="center">
<div>
<div id="next" style="position:relative;">
<table cellpadding="0" cellspacing="0" bgcolor="#8f8f8f" width="60px" height="30px">
<tr><td class="caseTB">&</td><td class="caseTB">&</td><td class="caseTB">&</td><td class="caseTB">&</td></tr>
<tr><td class="caseTB">&</td><td class="caseTB">&</td><td class="caseTB">&</td><td class="caseTB">&</td></tr>
</table>
</div></div></td></tr>
</table>
<br><br>
<form name="main">
<input type="button" name="start" value="COMMENCER" onclick="clearTimeout(ok);if (pause) {pause=false;partieEnCour();this.value='PAUSE'} else {if (this.value=='COMMENCER') {nouvellePartie();this.value='PAUSE'} else {this.value='CONTINUER';pause = true;}}">
<br><br><input type="button" value="AIDE" onclick="help();">
<br><br>
<table>
<tr><td>Pointage</td><td>: <input class="inpText" name="points" type="text" value="0" size="6"></td></tr>
<tr><td>Niveau</td><td>: <input class="inpText" name="niveaux" type="text" value="0" size="6"></td></tr>
<tr><td>Lignes</td><td>: <input class="inpText" name="lignes" type="text" value="0" size="6"></td></tr>
</table>
</form>
</td>
</tr>
</table>
</td></tr>
</table>
<div style="position:absolute;top:-100px;left:0px;">
<form name="key" onsubmit="return false;"><input name="down" type="texte" value=""></form>
</div>
<div id="aide">
<b>Règles du jeu.</b>
<p class="para">Le jeu est basé sue le jeu classique TETRIS. Le but est de placer des formes (7 formes cubiques différentes) qui descendent du haut vers la bas d'un tableau pour en former des lignes horizontales pleines. Dès qu'elle est pleine, la ligne est détruite et tous les cubes au-dessus de la ligne descendent d'une rangée.</p>
<p class="para">Les touches de directions (flèches) et la barre d'espacement sont utilises dans le jeu. Les flèches droite et gauche pour contrôler horizontalement la forme qui descend. Les flèches du haut et bas pour contrôler la rotation de la forme.</p>
<p class="para">A chaque multiple de cinq lignes complétées, le niveau de difficulté augmente de 1 et la vitesse de descente également.</p>
<p class="para">Le jeu se termine lorsqu'il n'est plus possible de faire descendre des formes sur le tableau.</p>
<br>
<b>Attribution des points :</b>
<p>(1 point * niveau de difficulté) est attribuée lorsqu'une forme est placée sur le tableau ainsi qu'a chaque rangée descendu par la forme lors de l'utilisation de la barre d'espacement.</p>
<p>100 points sont attribués lorsqu'une ligne est complétée.</p>
<p style="float:left;">Bonne partie.</p><div style="float:right;"><button onclick="document.getElementById('aide').style.display='none';">Quitter</button></div>
</div>
</body>
</html> |
ps:fait un copier coller et met le sur une page a par |
|
|
Arthur dreamweaver mioche
|
jeux , Posté le: 09-04-2006 8:56 |
|
|
Merci mais maintenant sait tu comment on fait pour mettre un
jeux de sa propre creation??
(avec rpg maker xp , ou fps creator! |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 15-04-2006 14:28 |
|
|
il etait bien au moins?
ben tu fait un lien sur le ".exe" |
|
|
tetedeveau frontpage mioche
|
faire un site , Posté le: 24-04-2006 12:35 |
|
|
coment pouvons nous faire un site similaira a
-www.ogame.fr
merci de repondre vite |
|
|
salemioche salemioche
|
jeux , Posté le: 24-04-2006 12:38 |
|
|
c'est un site tout packagé, regardez ne bas a gauche, Gameforge... |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 27-04-2006 13:33 |
|
|
salemioche a écrit: |
c'est un site tout packagé, regardez ne bas a gauche, Gameforge... |
c'est quoi "ne bas a gauche, Gameforge" |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 27-04-2006 13:34 |
|
|
par contre j'en veut bien un comme sa tout fait |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 27-04-2006 13:34 |
|
|
avec le fichier SQL tout fait plus qu'a s'inscrire |
|
|
Arthur dreamweaver mioche
|
jeux , Posté le: 28-04-2006 11:50 |
|
|
au fait matt merci pour ton jeu je l'ai mis sur mon site sa donne un bon effet!! |
|
|
roro14 frontpage mioche
|
reponse , Posté le: 28-04-2006 17:25 |
|
|
merci pour tout |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 29-04-2006 9:00 |
|
|
tu veux un morpion?
tien je te le donne par contre il faut des images
donc
sa c pour les case non cochée il va s'appeller blank.jpg
sa c pour les croix il va s'appeller x.jpg
sa pour les rond il va s'appeller o.jpg
tu les copie tu les colle dans un dossier "images"
puis dans un fichier morpion.htm tu met se code :
entre <head> et </head>
Code: |
<!-- Begin
var x = "images/x.jpg";
// Location of where you uploaded your site's x.jpg image
var o = "images/o.jpg";
// Location of where you uploaded your site's o.jpg image
var blank = "images/blank.jpg";
// Location of where you uploaded your site's blank.jpg image
var pause = 0;
var all = 0;
var a = 0;
var b = 0;
var c = 0;
var d = 0;
var e = 0;
var f = 0;
var g = 0;
var h = 0;
var i = 0;
var temp="";
var ok = 0;
var cf = 0;
var choice=9;
var aRandomNumber = 0;
var comp = 0;
var t = 0;
var wn = 0;
var ls = 0;
var ts = 0;
function help() {
alert("Bienvenue sur le jeu du morpion !Choisis le carré ou tu veux mettre ta croix, le but étant de faire une ligne complète. Bonne chance !!")
}
function sommaire() {
window.location='METTEZ ICI L URL DE VOTRE SOMMAIRE';
}
// window.open('help.html','Aide','width=400,height=400,scrollbars=1');
function logicOne() {
if ((a==1)&&(b==1)&&(c==1)) all=1;
if ((a==1)&&(d==1)&&(g==1)) all=1;
if ((a==1)&&(e==1)&&(i==1)) all=1;
if ((b==1)&&(e==1)&&(h==1)) all=1;
if ((d==1)&&(e==1)&&(f==1)) all=1;
if ((g==1)&&(h==1)&&(i==1)) all=1;
if ((c==1)&&(f==1)&&(i==1)) all=1;
if ((g==1)&&(e==1)&&(c==1)) all=1;
if ((a==2)&&(b==2)&&(c==2)) all=2;
if ((a==2)&&(d==2)&&(g==2)) all=2;
if ((a==2)&&(e==2)&&(i==2)) all=2;
if ((b==2)&&(e==2)&&(h==2)) all=2;
if ((d==2)&&(e==2)&&(f==2)) all=2;
if ((g==2)&&(h==2)&&(i==2)) all=2;
if ((c==2)&&(f==2)&&(i==2)) all=2;
if ((g==2)&&(e==2)&&(c==2)) all=2;
if ((a != 0)&&(b != 0)&&(c != 0)&&(d != 0)&&(e != 0)&&(f != 0)&&(g != 0)&&(h != 0)&&(i != 0)&&(all == 0)) all = 3;
}
function logicTwo() {
if ((a==2)&&(b==2)&&(c== 0)&&(temp=="")) temp="C";
if ((a==2)&&(b== 0)&&(c==2)&&(temp=="")) temp="B";
if ((a== 0)&&(b==2)&&(c==2)&&(temp=="")) temp="A";
if ((a==2)&&(d==2)&&(g== 0)&&(temp=="")) temp="G";
if ((a==2)&&(d== 0)&&(g==2)&&(temp=="")) temp="D";
if ((a== 0)&&(d==2)&&(g==2)&&(temp=="")) temp="A";
if ((a==2)&&(e==2)&&(i== 0)&&(temp=="")) temp="I";
if ((a==2)&&(e== 0)&&(i==2)&&(temp=="")) temp="E";
if ((a== 0)&&(e==2)&&(i==2)&&(temp=="")) temp="A";
if ((b==2)&&(e==2)&&(h== 0)&&(temp=="")) temp="H";
if ((b==2)&&(e== 0)&&(h==2)&&(temp=="")) temp="E";
if ((b== 0)&&(e==2)&&(h==2)&&(temp=="")) temp="B";
if ((d==2)&&(e==2)&&(f== 0)&&(temp=="")) temp="F";
if ((d==2)&&(e== 0)&&(f==2)&&(temp=="")) temp="E";
if ((d== 0)&&(e==2)&&(f==2)&&(temp=="")) temp="D";
if ((g==2)&&(h==2)&&(i== 0)&&(temp=="")) temp="I";
if ((g==2)&&(h== 0)&&(i==2)&&(temp=="")) temp="H";
if ((g== 0)&&(h==2)&&(i==2)&&(temp=="")) temp="G";
if ((c==2)&&(f==2)&&(i== 0)&&(temp=="")) temp="I";
if ((c==2)&&(f== 0)&&(i==2)&&(temp=="")) temp="F";
if ((c== 0)&&(f==2)&&(i==2)&&(temp=="")) temp="C";
if ((g==2)&&(e==2)&&(c== 0)&&(temp=="")) temp="C";
if ((g==2)&&(e== 0)&&(c==2)&&(temp=="")) temp="E";
if ((g== 0)&&(e==2)&&(c==2)&&(temp=="")) temp="G";
}
function logicThree() {
if ((a==1)&&(b==1)&&(c==0)&&(temp=="")) temp="C";
if ((a==1)&&(b==0)&&(c==1)&&(temp=="")) temp="B";
if ((a==0)&&(b==1)&&(c==1)&&(temp=="")) temp="A";
if ((a==1)&&(d==1)&&(g==0)&&(temp=="")) temp="G";
if ((a==1)&&(d==0)&&(g==1)&&(temp=="")) temp="D";
if ((a==0)&&(d==1)&&(g==1)&&(temp=="")) temp="A";
if ((a==1)&&(e==1)&&(i==0)&&(temp=="")) temp="I";
if ((a==1)&&(e==0)&&(i==1)&&(temp=="")) temp="E";
if ((a==0)&&(e==1)&&(i==1)&&(temp=="")) temp="A";
if ((b==1)&&(e==1)&&(h==0)&&(temp=="")) temp="H";
if ((b==1)&&(e==0)&&(h==1)&&(temp=="")) temp="E";
if ((b==0)&&(e==1)&&(h==1)&&(temp=="")) temp="B";
if ((d==1)&&(e==1)&&(f==0)&&(temp=="")) temp="F";
if ((d==1)&&(e==0)&&(f==1)&&(temp=="")) temp="E";
if ((d==0)&&(e==1)&&(f==1)&&(temp=="")) temp="D";
if ((g==1)&&(h==1)&&(i==0)&&(temp=="")) temp="I";
if ((g==1)&&(h==0)&&(i==1)&&(temp=="")) temp="H";
if ((g==0)&&(h==1)&&(i==1)&&(temp=="")) temp="G";
if ((c==1)&&(f==1)&&(i==0)&&(temp=="")) temp="I";
if ((c==1)&&(f==0)&&(i==1)&&(temp=="")) temp="F";
if ((c==0)&&(f==1)&&(i==1)&&(temp=="")) temp="C";
if ((g==1)&&(e==1)&&(c==0)&&(temp=="")) temp="C";
if ((g==1)&&(e==0)&&(c==1)&&(temp=="")) temp="E";
if ((g==0)&&(e==1)&&(c==1)&&(temp=="")) temp="G";
}
function clearOut() {
document.game.you.value="0";
document.game.computer.value="0";
document.game.ties.value="0";
}
function checkSpace() {
if ((temp=="A")&&(a==0)) {
ok=1;
if (cf==0) a=1;
if (cf==1) a=2;
}
if ((temp=="B")&&(b==0)) {
ok=1;
if (cf==0) b=1;
if (cf==1) b=2;
}
if ((temp=="C")&&(c==0)) {
ok=1;
if (cf==0) c=1;
if (cf==1) c=2;
}
if ((temp=="D")&&(d==0)) {
ok=1;
if (cf==0) d=1;
if (cf==1) d=2;
}
if ((temp=="E")&&(e==0)) {
ok=1;
if (cf==0) e=1;
if (cf==1) e=2;
}
if ((temp=="F")&&(f==0)) {
ok=1
if (cf==0) f=1;
if (cf==1) f=2;
}
if ((temp=="G")&&(g==0)) {
ok=1
if (cf==0) g=1;
if (cf==1) g=2;
}
if ((temp=="H")&&(h==0)) {
ok=1;
if (cf==0) h=1;
if (cf==1) h=2;
}
if ((temp=="I")&&(i==0)) {
ok=1;
if (cf==0) i=1;
if (cf==1) i=2;
}
}
function yourChoice(chName) {
pause = 0;
if (all!=0) ended();
if (all==0) {
cf = 0;
ok = 0;
temp=chName;
checkSpace();
if (ok==1) {
document.images[chName].src = x;
}
if (ok==0)taken();
process();
if ((all==0)&&(pause==0)) myChoice();
}
}
function taken() {
alert("Ce carré est deja prit. Prens un autre carré.")
pause=1;
}
function myChoice() {
temp="";
ok = 0;
cf=1;
logicTwo();
logicThree();
checkSpace();
while(ok==0) {
aRandomNumber=Math.random()
comp=Math.round((choice-1)*aRandomNumber)+1;
if (comp==1) temp="A";
if (comp==2) temp="B";
if (comp==3) temp="C";
if (comp==4) temp="D";
if (comp==5) temp="E";
if (comp==6) temp="F";
if (comp==7) temp="G";
if (comp==8) temp="H";
if (comp==9) temp="I";
checkSpace();
}
document.images[temp].src= o;
process();
}
function ended() {
alert("La partie est finit. Pour jouer encore cliques sur jouer encore.")
}
function process() {
logicOne();
if (all==1){ alert("Félicitation, tu gagnes!"); wn++; }
if (all==2){ alert("tu perds!"); ls++; }
if (all==3){ alert("Match nul!."); ts++; }
if (all!=0) {
document.game.you.value = wn;
document.game.computer.value = ls;
document.game.ties.value = ts;
}
}
function playAgain() {
if (all==0) {
if(confirm("Ceci va recommencer une autre partie et remettre les points a zero. OK?")) reset();
}
if (all>0) reset();
}
function reset() {
all = 0;
a = 0;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
g = 0;
h = 0;
i = 0;
temp="";
ok = 0;
cf = 0;
choice=9;
aRandomNumber = 0;
comp = 0;
document.images.A.src= blank;
document.images.B.src= blank;
document.images.C.src= blank;
document.images.D.src= blank;
document.images.E.src= blank;
document.images.F.src= blank;
document.images.G.src= blank;
document.images.H.src= blank;
document.images.I.src= blank;
if (t==0) { t=2; myChoice(); }
t--;
}
// End -->
</script>
|
et entre <body> et </body> sa
Code: |
<div align="center">
<center>
<table width="325" height="257" style="border-collapse:collapse" bgcolor="#0099FF" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="257">
<p align="center"><font face="Tekton" size="3"><b>Cliques sur un carré pour commencer</b></font>
<form name=game>
<table border=0>
<td>
<table border=1>
<tr>
<td><a href="javascript:yourChoice('A')"><img src="images/blank.jpg" border=0 name=A alt="Top-Left" width="90" height="90"></a></td>
<td><a href="javascript:yourChoice('B')"><img src="images/blank.jpg" border=0 name=B alt="Top-Center" width="90" height="90"></a></td>
<td><a href="javascript:yourChoice('C')"><img src="images/blank.jpg" border=0 name=C alt="Top-Right" width="90" height="90"></a></td>
</tr>
<tr>
<td><a href="javascript:yourChoice('D')"><img src="images/blank.jpg" border=0 name=D alt="Middle-Left" width="90" height="90"></a></td>
<td><a href="javascript:yourChoice('E')"><img src="images/blank.jpg" border=0 name=E alt="Middle-Center" width="90" height="90"></a></td>
<td><a href="javascript:yourChoice('F')"><img src="images/blank.jpg" border=0 name=F alt="Middle-Right" width="90" height="90"></a></td>
</tr>
<tr>
<td><a href="javascript:yourChoice('G')"><img src="images/blank.jpg" border=0 name=G alt="Bottom-Left" width="90" height="90"></a></td>
<td><a href="javascript:yourChoice('H')"><img src="images/blank.jpg" border=0 name=H alt="Bottom-Center" width="90" height="90"></a></td>
<td><a href="javascript:yourChoice('I')"><img src="images/blank.jpg" border=0 name=I alt="Bottom-Right" width="90" height="90"></a></td>
</tr>
</table>
</td>
<td>
<table height="356">
<tr>
<td colspan="2" align="center" height="79"></td>
</tr>
<tr>
<td colspan="2" align="center" height="21"><b><font face="Tekton">SCORES</font></b></td>
</tr>
<tr><td height="25"><input type=text size=5 name=you></td><td height="25"><b><font face="Tekton">Toi</font></b></td></tr>
<tr><td height="25"><input type=text size=5 name=computer></td><td height="25"><b><font face="Tekton">Ordinateur</font></b></td></tr>
<tr>
<td height="25"><input size=5 name=ties></td><td height="25"><b><font face="Tekton">Nul</font></b></td>
</tr>
<tr>
<td colspan="2" align="center" height="40"><font color="#FF6600"><b><font size="4">©</font><font size="2">
2004</font></b><font size="4"> <a href="http://lpv.hautetfort.com/">lpv</a></font></font></td>
</tr>
<tr>
<td colspan="2" align="center" height="113">vous pouvez mettre ici votre logo</td>
</tr>
</table>
</td>
</table>
<p align="center">
<input type=button value="Jouer encore" onClick="playAgain();" style="border: 5px double #000000; ">
<input type=button value="Aide " onClick="help();" style="border: 5px double #000000; ">
<input type=button value="Retour sommaire" onClick="sommaire();" style="border: 5px double #000000; ">
</form>
</td>
</tr>
</table>
</center>
</div>
|
tu m'en dira des nouvelle |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 29-04-2006 9:03 |
|
|
je présise que le dossier images doi être dans le même répertoire que morpion.htm sinon on voit rien |
|
|
Arthur dreamweaver mioche
|
jeux , Posté le: 30-04-2006 18:18 |
|
|
merci beaucoup je ne sais pas comment te remercier!! |
|
|
Mat 3910 html mioche
|
jeux , Posté le: 03-05-2006 13:15 |
|
|
sa marche ?
j'ai trouvé sa et je veut en faire profiter les autre
c'est tout |
|
|
|
|
S'enregistrer
Profil
Se connecter pour vérifier ses messages privés
Rechercher
Membres
FAQ
Connexion
|