BlueGit

timfa raytracer

Files

raytracer / archive / legacy-js / js / Tiles.js

Tiles.js

Tiles.js 877 B Download Raw
1var Tiles =
2{
3 Nothing:
4 {
5 ID: 0,
6 Color: {
7 R: 255,
8 G: 255,
9 B: 255
10 },
11 Solid: false
12 },
13 Stone:
14 {
15 ID: 1,
16 Color: {
17 R: 155,
18 G: 155,
19 B: 155
20 },
21 Image: new image("images/stone.png", 16, 16),
22 Solid: true
23 },
24 Finish:
25 {
26 ID: 2,
27 Color: {
28 R: 255,
29 G: 255,
30 B: 0
31 },
32 Solid: false
33 },
34 Wood:
35 {
36 ID: 3,
37 Color: {
38 R: 168,
39 G: 102,
40 B: 50
41 },
42 Image: new image("images/wood.png", 16, 16),
43 Solid: true
44 },
45 findByID(id)
46 {
47 for (const [key, value] of Object.entries(Tiles))
48 {
49 if(value.ID == id)
50 return value;
51 }
52 }
53}