Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //De index.php
- <!DOCTYPE html>
- <html>
- <head>
- <title>Deriom</title>
- <link rel="stylesheet" type="text/css" href="./styles/style.css" />
- <script type="text/javascript" src="./scripts/main.js"></script>
- </head>
- <body onload="init();">
- <canvas id="game">
- <p>Your browser doesn't support HTML5!</p>
- </canvas>
- </body>
- </html>
- //De main.js
- //Fields
- var canvas;
- var context;
- var character;
- //Functions
- function init(){
- canvas = document.getElementById("game");
- context = canvas.getContext("2d");
- character = new player();
- }
- function player(){
- this.name = "Derpy";
- this.x = 64;
- this.y = 64;
- setInterval("this.draw();",10);
- function draw(){
- context.fillStyle = "0000FF";
- context.fillRect(100,100,100,100);
- }
- }
Add Comment
Please, Sign In to add comment