exei kanis to kwdika

Κώδικας, πληροφορίες, ερωτήσεις και απαντήσεις σχετικές με την JavaScript.

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 14 Ιουν 2004 20:54

gia to game fidaki (ayto poy exei sta kinita NOKIA an mporei na me help kapoios psaxno sa trellos ayto to scriptaki

Άβαταρ μέλους
ThyClub
Honorary Member
Δημοσιεύσεις: 5312
Εγγραφή: 17 Νοέμ 2003 00:21
Τοποθεσία: Hell's Kitchen
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από ThyClub » 14 Ιουν 2004 21:13

Νομίζω είναι αυτός:

Κώδικας: Επιλογή όλων

sdhfjksdhfjkssdf465gd4g65d4gf65df5h
πλακίτσα :wink:

εδώ:
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Clayton Carlson (clayton@awebmaker.com) -->
<!-- Web Site: http://www.awebmaker.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var height = 20; //height of the game area
var width = 20; //width of the game area
var speed = 100 //speed, higher = slower
width += 2;
var a = 0;
var b = 0;
document.write("<table bgcolor=white bordercolor=black ");
document.write("align=center border=1 cellpadding=0 cellspacing=0><tr><td>");
for (b = 0; b < height+2; b++) {
document.write("<img src=end.gif width=0 height=0>");
for (a = 0; a < width- 2; a++) {
if ((b == 0) || (b == height+1)) {
document.write("<img src=end.gif width=0 height=0>");
}
else {
document.write("<img src=blank.gif width=15 height=15>");
}
}
document.write("<img src=end.gif width=0 height=0><br>");
}
document.write("</td>");
document.write("<td valign=top align=center bgcolor=white>");
document.write("<p align=center><strong><font color=blue>Snake</font></strong></p>");
document.write("<br>");
document.write("<form name=info>");
document.write("<input type=button size=28 value=0 class=worm1></form>");
document.write("<br><font size=-2>Press any arrow key to start</font></td></tr></table>");

var points = 0;
var go = 1;
var di = 0;
var x = 0;
var y = 0;
var n = 0;
document.images[1].src = "blank.gif";
var blank = document.images[1].src;
var hw = (height * width);
var o = Math.floor(Math.random() * hw - 2);
do {
o = Math.floor(Math.random() * hw-2);
} while(document.images[o].src != blank);
var i = o;
var food = 0;
do {
food = Math.floor(Math.random() * hw-2);
} while (document.images[food].src != blank);
document.images.src = "worm.gif";
document.images[width-1].src="end.gif";
var end = document.images[width-1].src;
var file = document.images.src;
var length = 1;
var worm = new Array();
var k = 0;
var ie = document.all ? 1 : 0;
var enableScroll = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >3)) ;
var height = document.images[0].height;
var tScroll;
var d = 0;
function runTimer() {
if (d != 0) { n++; }
if (d == 1) { i--; }
if (d == 2) { i++; }
if (d == 3) { i += width; }
if (d == 4) { i -= width; }
if (document.images.src == end) {
speed -= 400; i = worm[n-1]; di = 1; die();
}
worm[n] = i;
if(i == food) {
length++; points += (10*length);
do {
food = Math.floor(Math.random() * hw-2);
} while (document.images[food].src != blank);
if (di == 0) {
document.info.elements[0].value = points;
}
}
if (n > length){
o = worm[n-length];
}
if ((document.images.src == file) && (n > 1)) {
speed -= 400; d = 0; di = 1; die();
}
if(di == 0) {
document.images[o].src = "blank.gif";
document.images.src = "worm.gif";
document.images[food].src = "food.gif";
tScroll = window.setTimeout("runTimer();", speed);
}
}
if (enableScroll){
if (ie) window.onload = runTimer;
if (ie) window.onunload = new Function("clearTimeout(tScroll)");
}
systm = "";
ver = navigator.appVersion;
len = ver.length;
for (iln = 0;iln < len; iln++) if (ver.charAt(iln) == "(") break;
systm = ver.charAt(iln+1).toUpperCase();
document.onkeydown = keyDown;
if (systm != "C") {
document.captureEvents(Event.KEYDOWN);
}
function keyDown(DnEvents) {
if (systm != "C") {
k = DnEvents.which;
} else {
k = window.event.keyCode;
}
if (k == 37) { d = 1; }
if (k == 39) { d = 2; }
if (k == 40) { d = 3; }
if (k == 38) { d = 4; }
}
function die() {
i = 0;
o = 0;
food = 0;
document.info.elements[0].value = "Died with " + document.info.elements[0].value;
var restart=confirm("Play Again?");
if(restart){ location.reload(); }
}
// End -->
</script>

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 14 Ιουν 2004 21:34

tnxxx man youpiiiiiiiiiiiiiiiiii - lol

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 14 Ιουν 2004 21:37

xmm sigyra eine ok o kwdikas de my bgeni ,,

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 14 Ιουν 2004 21:40

ayto mipos eine java kati se javascript de yparxei ?

Άβαταρ μέλους
ThyClub
Honorary Member
Δημοσιεύσεις: 5312
Εγγραφή: 17 Νοέμ 2003 00:21
Τοποθεσία: Hell's Kitchen
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από ThyClub » 14 Ιουν 2004 22:46

:o
Javascript είναι :wink:

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 14 Ιουν 2004 23:06

nai ok sosta emena mu bgazei error omos

Άβαταρ μέλους
ThyClub
Honorary Member
Δημοσιεύσεις: 5312
Εγγραφή: 17 Νοέμ 2003 00:21
Τοποθεσία: Hell's Kitchen
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από ThyClub » 14 Ιουν 2004 23:11

Κώδικας: Επιλογή όλων

<HEAD>

<STYLE TYPE="text/css">
.item&#123;&#125;
.worm1 &#123;
  font-weight&#58;bold;
  font-size&#58;12pt;
  color&#58;blue;
  background&#58;white;
  width&#58;150px;
  BORDER-BOTTOM&#58; #ffffff solid 0px; 
  BORDER-TOP&#58; #ffffff solid 0px; 
  BORDER-LEFT&#58; #ffffff solid 0px; 
  BORDER-RIGHT&#58; #ffffff solid 0px; 
&#125;
.worm2 &#123;
  font-weight&#58;bold;
  font-size&#58;12pt;
  color&#58;red;
  background&#58;white;
  width&#58;150px;
  BORDER-BOTTOM&#58; #ffffff solid 0px; 
  BORDER-TOP&#58; #ffffff solid 0px; 
  BORDER-LEFT&#58; #ffffff solid 0px; 
  BORDER-RIGHT&#58; #ffffff solid 0px; 
&#125;
.info &#123;
  font-weight&#58;bold;
  font-size&#58;10pt;
  color&#58;black;
  background&#58;white;
  width&#58;150px;
  height&#58;100px;
  BORDER-BOTTOM&#58; #ffffff solid 0px; 
  BORDER-TOP&#58; #ffffff solid 0px; 
  BORDER-LEFT&#58; #ffffff solid 0px; 
  BORDER-RIGHT&#58; #ffffff solid 0px; 
&#125;
</style>
</HEAD>

<BODY bgcolor="white">
<FONT face="arial"><TABLE><TR><TD VALIGN="top">
<script type="text/javascript">
<!--
google_ad_client = 'pub-0732547639872881';
google_alternate_color = 'FFFFFF';
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = '160x600_as';
google_ad_channel ='2998655301';
// -->
</script>
<script type="text/javascript"
  src="http&#58;//pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<FORM ACTION="/SupportNanday.phtml" METHOD="POST">    <!-- HEIGHT=121 WIDTH=120  -->
<INPUT TYPE="IMAGE" SRC="/NandayAds.jpg"  ALIGN="ABSMIDDLE" BORDER=0>
</FORM></TD><TD>&nbsp; &nbsp; </TD><TD VALIGN="top" ALIGN="center" WIDTH="100%"><FONT FACE="arial"><CENTER>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original&#58;  Clayton Carlson &#40;clayton@awebmaker.com&#41; -->
<!-- Web Site&#58;  http&#58;//www.awebmaker.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http&#58;//javascript.internet.com -->

<!-- Begin
var height = 20; //height of the game area
var width = 20;	//width of the game area
var speed = 100	//speed, higher = slower
width += 2;
var a = 0;
var b = 0;
document.write&#40;"<table bgcolor=white bordercolor=black "&#41;;
document.write&#40;"align=center border=1 cellpadding=0 cellspacing=0><tr><td>"&#41;;
for &#40;b = 0; b < height+2; b++&#41; &#123;
document.write&#40;"<img src=end.gif width=0 height=0>"&#41;;
for &#40;a = 0; a < width- 2; a++&#41; &#123;
if &#40;&#40;b == 0&#41; || &#40;b == height+1&#41;&#41; &#123;
document.write&#40;"<img src=end.gif width=0 height=0>"&#41;;
&#125;
else &#123;
document.write&#40;"<img src=blank.gif width=15 height=15>"&#41;;
   &#125;
&#125;
document.write&#40;"<img src=end.gif width=0 height=0><br>"&#41;;
&#125;
document.write&#40;"</td>"&#41;;
document.write&#40;"<td valign=top align=center bgcolor=white>"&#41;;
document.write&#40;"<p align=center><strong><font color=blue>Snake</font></strong></p>"&#41;;
document.write&#40;"<br>"&#41;;
document.write&#40;"<form name=info>"&#41;;
document.write&#40;"<input type=button size=28 value=0 class=worm1></form>"&#41;;
document.write&#40;"<br><font size=-2>Press any arrow key to start</font></td></tr></table>"&#41;;

var points = 0;
var go = 1;
var di = 0;
var x = 0;
var y = 0;
var n = 0;
document.images&#91;1&#93;.src = "blank.gif"; 
var blank = document.images&#91;1&#93;.src;
var hw = &#40;height * width&#41;;
var o = Math.floor&#40;Math.random&#40;&#41; * hw - 2&#41;;
do &#123;
o = Math.floor&#40;Math.random&#40;&#41; * hw-2&#41;;
&#125; while&#40;document.images&#91;o&#93;.src != blank&#41;;
var i = o;
var food = 0;
do &#123;
food = Math.floor&#40;Math.random&#40;&#41; * hw-2&#41;;
&#125; while &#40;document.images&#91;food&#93;.src != blank&#41;;
document.images&#91;i&#93;.src = "worm.gif";
document.images&#91;width-1&#93;.src="end.gif";
var end = document.images&#91;width-1&#93;.src;
var file = document.images&#91;i&#93;.src;
var length = 1;
var worm = new Array&#40;&#41;;
var k = 0;
var ie = document.all ? 1 &#58; 0;
var  enableScroll = &#40;&#40;navigator.appName == "Microsoft Internet Explorer"&#41; && &#40;parseInt&#40;navigator.appVersion&#41; >3&#41;&#41; ;
var height = document.images&#91;0&#93;.height;
var tScroll;
var d = 0;
function runTimer&#40;&#41; &#123;
if &#40;d != 0&#41; &#123; n++; &#125;
if &#40;d == 1&#41; &#123; i--; &#125;
if &#40;d == 2&#41; &#123; i++; &#125;
if &#40;d == 3&#41; &#123; i += width; &#125;
if &#40;d == 4&#41; &#123; i -= width; &#125;
if &#40;document.images&#91;i&#93;.src == end&#41; &#123;
speed -= 400; i = worm&#91;n-1&#93;; di = 1; die&#40;&#41;;
&#125;
worm&#91;n&#93; = i;
if&#40;i == food&#41; &#123;
length++; points += &#40;10*length&#41;;
do &#123;
food = Math.floor&#40;Math.random&#40;&#41; * hw-2&#41;;
&#125; while &#40;document.images&#91;food&#93;.src != blank&#41;;
if &#40;di == 0&#41; &#123;
document.info.elements&#91;0&#93;.value = points;
   &#125;
&#125;
if &#40;n > length&#41;&#123;
o = worm&#91;n-length&#93;;
&#125;
if &#40;&#40;document.images&#91;i&#93;.src == file&#41; && &#40;n > 1&#41;&#41; &#123;
speed -= 400; d = 0; di = 1; die&#40;&#41;;
&#125;
if&#40;di == 0&#41; &#123;
document.images&#91;o&#93;.src = "blank.gif";
document.images&#91;i&#93;.src = "worm.gif";
document.images&#91;food&#93;.src = "food.gif";
tScroll = window.setTimeout&#40;"runTimer&#40;&#41;;", speed&#41;;
   &#125;
&#125;
if &#40;enableScroll&#41;&#123;
if &#40;ie&#41; window.onload = runTimer;
if &#40;ie&#41; window.onunload = new Function&#40;"clearTimeout&#40;tScroll&#41;"&#41;;
&#125;
systm = "";
ver = navigator.appVersion;
len = ver.length;
for &#40;iln = 0;iln < len; iln++&#41; if &#40;ver.charAt&#40;iln&#41; == "&#40;"&#41; break;
systm = ver.charAt&#40;iln+1&#41;.toUpperCase&#40;&#41;;
document.onkeydown = keyDown;
if &#40;systm != "C"&#41; &#123;
document.captureEvents&#40;Event.KEYDOWN&#41;;
&#125;
function keyDown&#40;DnEvents&#41; &#123;
if &#40;systm != "C"&#41; &#123;
k = DnEvents.which;
&#125; else &#123;
k = window.event.keyCode;
&#125;
if &#40;k == 37&#41; &#123; d = 1; &#125;
if &#40;k == 39&#41; &#123; d = 2; &#125;
if &#40;k == 40&#41; &#123; d = 3; &#125;
if &#40;k == 38&#41; &#123; d = 4; &#125;
&#125;
function die&#40;&#41; &#123;
i = 0;
o = 0;
food = 0;
document.info.elements&#91;0&#93;.value = "Died with " + document.info.elements&#91;0&#93;.value;
var restart=confirm&#40;"Play Again?"&#41;;
if&#40;restart&#41;&#123; location.reload&#40;&#41;; &#125;
&#125;
// End -->
</script>

<P><BR><BR>
In this game, you are a snake which is continuously moving. Your goal is to
get the apple as many times as possible without hitting a wall or any part of your body.
Each time you "eat" an apple, your body grows one segment longer, so the game gets harder and harder.
Move the snake using the arrow keys. Press any arrow key to begin.

<P><BR><A HREF="/games/">Nanday games main menu</A><BR>
<P><CENTER><FONT FACE="arial"><A HREF="/">Nanday.Com home</A>

</TD></TR></TABLE>
</CENTER>
</FONT>
</BODY>
Ελπίζω αυτό να δουλέψει :hammer:

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 15 Ιουν 2004 20:24

eine ok alla de kanei start (de xekinaei ...

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 15 Ιουν 2004 20:28

h mallon xekinaei alla de fenete to fidaki mporeis na my pis ti prepei na allaxo gia na fenete (giati olo sto toixo to karfono )P:

Άβαταρ μέλους
Basilakis
PHP Moderator
Δημοσιεύσεις: 8574
Εγγραφή: 17 Νοέμ 2003 13:03
Τοποθεσία: Womans' Brain
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από Basilakis » 15 Ιουν 2004 20:29

Πρέπει να κα΄νεις κλικ μέσα στο κουτί....

Άβαταρ μέλους
tolis_montana
Honorary Member
Δημοσιεύσεις: 913
Εγγραφή: 13 Απρ 2004 01:15
Τοποθεσία: στο κοσμο μου...
Επικοινωνία:

exei kanis to kwdika

Δημοσίευση από tolis_montana » 15 Ιουν 2004 20:30

kano xekiani na pezei alla einai aorato to fidaki !

Απάντηση

Επιστροφή στο “JavaScript και Frameworks”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 1 επισκέπτης