xxxxxxxxxx
48
let img = [];
let tilesize;
let size = 40;
let tilecount;
let tiles = [];
let w;
let h;
function preload() {
// img[0] = loadImage("xx.png");
// img[1] = loadImage("aa.png");
// img[2] = loadImage("bb.png");
// img[3] = loadImage("cc.png");
// img[4] = loadImage("dd.png");
}
function setup() {
createCanvas(400, 400);
tilesize = width/size * height/size;
tilecount = tilesize * width/height;
// for(let i = 0; i < tilecount; i++) {
// tiles[i] = {
// img: random(img),
// };
// }
w = tilesize * width;
h = tilesize * height;
}
function draw() {
background(220);
let x = 0;
let y = 0;
// for(let i = 0; i < h; i++) {
// for(let j = 0; j < w; j++) {
// image(tiles[(1)-1].img, x, y, tilesize, tilesize);
// x += tilesize;
// }
// y += tilesize;
// }
print(tilecount);
noLoop();
}