BlueGit

blue-star speeltuin

workaround

timfa Tim · pushed by timfa

Authored 2022-10-15 · 4 years ago

Hash
5ed72b3c44c63f9e76b696010f415bedcc8143f0
Parent
45deaf4b
1 file changed +4 −1
src/objects/grasstiler.js +4 −1
@@ -11,6 +11,9 @@ class GrassTiler extends GameObject
11 11
12 12 draw(context)
13 13 {
14 if(this.ground_dark.width == 0 || this.ground_light.width == 0)
15 return;
16
14 17 let width = this.scene.real_size.x + this.ground_dark.width
15 18 let height = this.scene.real_size.y + this.ground_dark.height
16 19 let count = 0;
@@ -19,7 +22,7 @@ class GrassTiler extends GameObject
19 22 for(let y = 0; y < height; y += this.ground_light.height)
20 23 {
21 24 count++;
22 ((count) %2 == 1? this.ground_dark : this.ground_light).draw(this.scene, 0, 0, this.ground_dark.width, this.ground_dark.height, x, y, this.ground_dark.width, this.ground_light.height, 0, 1)
25 ((count) %2 == 1? this.ground_dark : this.ground_light).draw(this.scene, 0, 0, this.ground_dark.width, this.ground_dark.height, x - 32, y, this.ground_dark.width, this.ground_light.height, 0, 1)
23 26 }
24 27
25 28 count = x/64 % 2;
@@ -11,6 +11,9 @@ class GrassTiler extends GameObject
11
11
12 draw(context)
12 draw(context)
13 {
13 {
14 if(this.ground_dark.width == 0 || this.ground_light.width == 0)
15 return;
16
14 let width = this.scene.real_size.x + this.ground_dark.width
17 let width = this.scene.real_size.x + this.ground_dark.width
15 let height = this.scene.real_size.y + this.ground_dark.height
18 let height = this.scene.real_size.y + this.ground_dark.height
16 let count = 0;
19 let count = 0;
@@ -19,7 +22,7 @@ class GrassTiler extends GameObject
19 for(let y = 0; y < height; y += this.ground_light.height)
22 for(let y = 0; y < height; y += this.ground_light.height)
20 {
23 {
21 count++;
24 count++;
22 ((count) %2 == 1? this.ground_dark : this.ground_light).draw(this.scene, 0, 0, this.ground_dark.width, this.ground_dark.height, x, y, this.ground_dark.width, this.ground_light.height, 0, 1)
25 ((count) %2 == 1? this.ground_dark : this.ground_light).draw(this.scene, 0, 0, this.ground_dark.width, this.ground_dark.height, x - 32, y, this.ground_dark.width, this.ground_light.height, 0, 1)
23 }
26 }
24
27
25 count = x/64 % 2;
28 count = x/64 % 2;