Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Cookie Clicker Basic</title>
- <style>
- #progress {
- background-color: red;
- }
- #cookie {
- position: absolute;
- top: 150px;
- }
- </style>
- <script>
- function hit()
- {
- //update score
- var score;
- score = document.getElementById("score").innerHTML;
- score++;
- document.getElementById("score").innerHTML = score;
- //move cookie
- var newX = Math.random() * 500;
- var newY = Math.random() * 500;
- document.getElementById("cookie").style.left = newX;
- document.getElementById("cookie").style.top = newY;
- }
- </script>
- </head>
- <body>
- <img id="cookie" src="cookie.jpg" alt="face" height="80" width="80" onClick="hit()">
- <br><br>
- <table border=1>
- <tr>
- <td>Score</td>
- <td id="score">0</td>
- </tr>
- </table>
- <br>
- <span id="progress">Progress Bar goes here</span>
- </body>
- </html>
Add Comment
Please, Sign In to add comment