topical media & game development

talk show tell print

game-javascript-casual-mr-patato-head-game.htm / htm



  
  <!-- ONE STEP TO INSTALL MR. POTATO HEAD:
  
     1.  Add the first code to the BODY of your HTML document  -->
  
  <!-- STEP ONE: Add the first code to the BODY of your HTML document  -->
  
  <HEAD>
  
  <SCRIPT LANGUAGE="JavaScript">
  <!-- Original:  Michael Tartaglia (stonedstan@hotmail.com) -->
  <!-- Web Site:  http://www.geocities.com/SiliconValley/Horizon/5235 -->
  
  <!-- This script and many more are available free online at -->
  <!-- The JavaScript Source!! http://javascript.internet.com -->
  
  <!-- Begin
  var h=0,e=0,n=0,m=0;
  var hChose="", eChose=":", nChose="-", mChose=")";
  document.write("<FORM NAME=\"theForm\"><CENTER>"
  + "<input type=text size=20 name=face>"
  +"<BR><input type=button value=Hair onClick='changeHair()'>"
  +"<input type=button value=Eyes onClick='changeEyes()'>"
  +"<input type=button value=Nose onClick='changeNose()'>"
  +"<input type=button value=Mouth onClick='changeMouth()'>  ");
  document.write("<input type=button value=View onClick='viewIt()'>");
  document.write("</CENTER></FORM>");
  document.theForm.face.value=hChose+" "+eChose+" "+nChose+mChose;
  hair=new Array("","[[[","2","3","(","\\/\\/","Ç");
  eyes=new Array("B",":\'",">:","<:",":",";","¦");
  nose=new Array("- ","^ ","* ","~ ","¤ ","");
  mouth=new Array("Þ","O","}","|",")","(",")~~",")===");
  function changeHair() {
  if (h == 6) {h=0} else (h++)
  hChose = hair[h];
  document.theForm.face.value=hChose+" "+eChose+" "+nChose+mChose;
  }
  function changeEyes() {
  if (e == 6) {e=0} else (e++)
  eChose = eyes[e];
  document.theForm.face.value=hChose+" "+eChose+" "+nChose+mChose;
  }
  function changeNose() {
  if (n == 5) {n=0} else (n++)
  nChose = nose[n];
  document.theForm.face.value=hChose+" "+eChose+" "+nChose+mChose;
  }
  function changeMouth() {
  if (m == 7) {m=0} else (m++)
  mChose = mouth[m];
  document.theForm.face.value=hChose+" "+eChose+" "+nChose+mChose;
  }
  function viewIt() {
  mth="";
  for (i=1;i<=mChose.length;i++) {mth += mChose.charAt(i)}
  see=window.open('','','width=200,height=175,toolbar=no,status=no,scrolling=no');
  see.document.write("<HTML><HEAD><TITLE>Mr. Potato Head</TITLE></HEAD><BODY>"
  + "<CENTER><FONT SIZE=7><B>"+hChose+" <FONT COLOR=blue>"
  + eChose + " </FONT>" + nChose + " <FONT COLOR=red>" 
  + mChose.charAt(0) + "</FONT>" + mth + "</B></FONT><br><br>"
  + "<FONT SIZE=2><I>Mr. Potato Head!</I></FONT><br>"
  + "<FONT SIZE=1>(<a href=\"javascript:this.close()\">"
  + "close</a>)</FONT></CENTER></BODY></HTML>");
  }
  // End -->
  </script>
  
  <p><center>
  <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
  by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  </center><p>
  
  <!-- Script Size:  2.49 KB  -->


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.