Advertisement
Guest User

game javascript test canvas html

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <canvas id="myCanvas" width="600" height="600">
  6. Your browser does not support the HTML5 canvas tag.</canvas>
  7.  
  8. <script>
  9.  
  10. var c = document.getElementById("myCanvas");
  11. var ctx = c.getContext("2d");
  12. function draw() {
  13. var x = 10;
  14. var y = 10;
  15. ctx.clearRect(0, 0, 600, 600);
  16. ctx.fillRect(x, y, 20, 20);
  17. document.addEventListener
  18. }
  19. setInterval(draw, 60);
  20. </script>
  21. </body>
  22. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement