Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy are these two positions ignored?
    text
    copied!<p>I am writing some javascript to create x and y coodinates from an array, so i have this code:</p> <pre><code>var map1 = [ gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg,gg, ]; for (var i=0; i&lt;map1.length; i++) { if (i &gt; 16) { dy = Math.floor(i / 15) * 16; } dx = i * 16 while (dx &gt;= 240) { dx = dx - 240; } } </code></pre> <p>And the code works extremely well, except for coordinates 0,1 and 1,1 arent working? These coordinates are building a canvas with 16px blocks using the principal on this page <a href="https://developer.mozilla.org/en-US/docs/HTML/Canvas/Tutorial/Using_images?redirectlocale=en-US&amp;redirectslug=Canvas_tutorial/Using_images" rel="nofollow">here</a>. And <code>dx</code> and <code>dy</code> fit into this equation, <code>ctx.drawImage(tileset, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);</code> Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload