Guest User

Untitled

a guest
Dec 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. //De index.php
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html>
  6. <head>
  7. <title>Deriom</title>
  8. <link rel="stylesheet" type="text/css" href="./styles/style.css" />
  9. <script type="text/javascript" src="./scripts/main.js"></script>
  10. </head>
  11. <body onload="init();">
  12. <canvas id="game">
  13. <p>Your browser doesn't support HTML5!</p>
  14. </canvas>
  15. </body>
  16. </html>
  17.  
  18. //De main.js
  19.  
  20. //Fields
  21. var canvas;
  22. var context;
  23. var character;
  24.  
  25. //Functions
  26. function init(){
  27. canvas = document.getElementById("game");
  28. context = canvas.getContext("2d");
  29.  
  30. character = new player();
  31. }
  32.  
  33. function player(){
  34. this.name = "Derpy";
  35. this.x = 64;
  36. this.y = 64;
  37. setInterval("this.draw();",10);
  38.  
  39. function draw(){
  40. context.fillStyle = "0000FF";
  41. context.fillRect(100,100,100,100);
  42. }
  43. }
Add Comment
Please, Sign In to add comment