-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathimages.js
30 lines (28 loc) · 995 Bytes
/
images.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export const images = [];
export const TILE_WIDTH = 56;
export const TILE_HEIGHT = 80;
const types = [
{ name: "dots", number: 9, multiplicity: 4 },
{ name: "bamboo", number: 9, multiplicity: 4 },
{ name: "character", number: 9, multiplicity: 4 },
{ name: "wind", number: 4, multiplicity: 4 },
{ name: "dragon", number: 3, multiplicity: 4 },
{ name: "flower", number: 4, multiplicity: 1 },
{ name: "season", number: 4, multiplicity: 1 },
];
for (const type of types) {
for (let j = 1; j <= type.number; j++) {
for (let i = 1; i <= type.multiplicity; i++) {
const image = $("<img></img>")
.css({
width: TILE_WIDTH,
height: TILE_HEIGHT,
})
.attr({
src: `./img/${type.name}${j}.png`,
type: type.multiplicity > 1 ? `${type.name}${j}` : type.name,
});
images.push(image);
}
}
}