BlueGit

blue-star speeltuin

Merge branch 'master' of https://gitlab.com/spark-imagination/speeltuin

timfa wsadhelios · pushed by timfa

Authored 2022-10-22 · 4 years ago

Hash
73f538e407584abb75970f61d38b311816671123
2 files changed +6 −1
src/minigame/frog/frogScene.js +2 −0
@@ -162,6 +162,8 @@ class FrogScene extends Scene
162 162 this.destroyFruit(fruit);
163 163
164 164 this.increaseDifficulty();
165
166 FruitInventory.Instance.addToInventory(fruit.renderer.subImage);
165 167 }
166 168
167 169 getNextExternalFruitPosition ()
@@ -162,6 +162,8 @@ class FrogScene extends Scene
162 this.destroyFruit(fruit);
162 this.destroyFruit(fruit);
163
163
164 this.increaseDifficulty();
164 this.increaseDifficulty();
165
166 FruitInventory.Instance.addToInventory(fruit.renderer.subImage);
165 }
167 }
166
168
167 getNextExternalFruitPosition ()
169 getNextExternalFruitPosition ()
src/objects/menus/fruitInventory.js +4 −1
@@ -13,8 +13,11 @@ class FruitInventory extends GameObject
13 13 if (!this.g_inv)
14 14 {
15 15 let inv = CookieManager.getCookie("fruitInventory");
16 inv = inv || "{}";
16 if (inv.length <= 0)
17 inv = "[]";
18
17 19 this.g_inv = JSON.parse(inv);
20 this.g_inv = this.g_inv || [];
18 21 }
19 22
20 23 return this.g_inv;
@@ -13,8 +13,11 @@ class FruitInventory extends GameObject
13 if (!this.g_inv)
13 if (!this.g_inv)
14 {
14 {
15 let inv = CookieManager.getCookie("fruitInventory");
15 let inv = CookieManager.getCookie("fruitInventory");
16 inv = inv || "{}";
16 if (inv.length <= 0)
17 inv = "[]";
18
17 this.g_inv = JSON.parse(inv);
19 this.g_inv = JSON.parse(inv);
20 this.g_inv = this.g_inv || [];
18 }
21 }
19
22
20 return this.g_inv;
23 return this.g_inv;