Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <title> Lords War </title>
- <style type="text/css">
- body {
- margin: 0; /*Per centrare il canvas*/
- }
- </style>
- </head>
- <body>
- <canvas id="myCanvas" width="800" height="600" style="border:1px solid #d3d3d3;">
- Your browser does not support the HTML5 canvas tag.</canvas>
- <script type="text/javascript">
- var c=document.getElementById("myCanvas");
- var ctx=c.getContext("2d");
- var quArray=[];
- //var bd1 = new BitmapData("griglia1.png");
- ctx.fillStyle = 'blue';
- ctx.fillRect(10, 20, 200, 100);
- creaGriglia();
- function creaGriglia(){
- for(i=0;i<=15;i++){ // y
- quArray[i]=[];
- for(j=0;j<=20;j++){ // x
- numX=j*40;
- numY=i*40;
- //si aggiunge l'immagine "griglia" all'elenco di visualizzazione
- //quArray[i][j] = b; // si aggiunge l'elemento all'array bidimensionale
- }
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement