Advertisement
MoDzFtW

Cookie Clicker javascript v0.3a

Nov 15th, 2013
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>Cookie Clacker</title>
  6. <b><font face="bankgothic lt bt" color="orange" size="4">
  7. <center>Welcome To Cookie Clacker<br><br>
  8. <div style="position: absolute; right: 0;">
  9. Shop
  10. <br>
  11. <button onclick="fdouble()" id="double">Double You're Cookies (100 Cookies)</button>
  12. <br>
  13. <button onclick="fbomb()" id="bomb">Atomic Bomb (400 Cookies)</button>
  14. <br />
  15. <button onclick="ftest()" id="test">Test (10000000000000 Cookies)</button>
  16. </div>
  17. <script type="text/javascript">
  18. var total = 0;
  19. var m = 1;
  20. var double = 0;
  21. var bomb = 0;
  22. var test = 0;
  23. var sizeddown = 0;
  24. function countClicks() {
  25.  total = total + m;
  26.     document.getElementById("cookies").innerHTML = total;
  27.     sizedown();
  28. }
  29. function sizedown(){
  30.     document.getElementById("cookie").innerHTML = "<img onclick='javascript:countClicks();' src='http://www.pindarcreative.co.uk/images/cookie.png' alt='alt text' width='245' height='245'/>"
  31. ;
  32. countdown = setTimeout('sizeup()', 50);
  33. setTimeout('sizeup()', 50);
  34. }
  35. function sizeup(){
  36.         document.getElementById("cookie").innerHTML = "<img onclick='javascript:countClicks();' src='http://www.pindarcreative.co.uk/images/cookie.png' alt='alt text' width='250' height='250'/>"
  37. ;
  38.     }
  39.    
  40. function fdouble() {
  41. if(total >= 100 && bomb == 0){
  42. total = total - 100;
  43. m = m*2;
  44. double = 1;
  45. document.getElementById("double").style.visibility="hidden";
  46. document.getElementById("cookies").innerHTML = total;
  47. }
  48. }
  49.  
  50. function fbomb() {
  51. if(total >= 400){
  52. total = total - 400;
  53. m = 100;
  54. document.getElementById("bomb").style.visibility="hidden";
  55. }
  56. document.getElementById("cookies").innerHTML = total;
  57. }
  58.  
  59.  
  60. function ftest(){
  61.     if(total >= 10){
  62.         test = 1;
  63.         total =  total - 10;
  64.         document.getElementById("test").style.visibility="hidden";
  65.         document.getElementById("cookies").innerHTML = total;
  66.     }
  67. }
  68. function countdown_trigger() {  
  69. if(test == 1){
  70. total++;
  71. }
  72. document.getElementById('cookies').innerHTML = total;
  73. countdown = setTimeout('countdown_trigger()', 1000);
  74. }
  75. setTimeout('countdown_trigger()', 1000);
  76.  
  77. </script>
  78. </font>
  79. </head>
  80. <body>
  81. <p id="cookie">
  82. <img onclick="javascript:countClicks();" src="http://www.pindarcreative.co.uk/images/cookie.png" alt="alt text" width="250" height="250"/>
  83. </p>
  84.  
  85. <font face="bankgothic lt bt" color="orange" size="4">Cookies: <p id="cookies" style="color:orange">0</font></p></b>
  86.  
  87. <body background="http://www.hdpaperwall.com/wp-content/uploads/2013/10/bg.jpg">
  88. </body></center>
  89.  
  90.  
  91. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement