User prompt
Add game.setboxdestroyes twhen box is swiped
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'updateBoxDestroyed')' in this line: 'self.parent.updateBoxDestroyed(true);' Line Number: 84
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setBoxDestroyed')' in this line: 'self.parent.setBoxDestroyed(true);' Line Number: 83
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setBoxDestroyed')' in this line: 'self.parent.setBoxDestroyed(true);' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'boxDestroyed')' in this line: 'self.parent.boxDestroyed = true;' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setBoxDestroyed')' in this line: 'self.parent.setBoxDestroyed();' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'boxDestroyed')' in this line: 'self.parent.boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'updateBoxDestroyed')' in this line: 'self.parent.updateBoxDestroyed(true);' Line Number: 53
User prompt
Do a callback from game to box to update the status of boxdestroyed
User prompt
Set selfboxdestoy true on swipe box
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'boxDestroyed')' in this line: 'self.parent.boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'getChildByName')' in this line: 'self.parent.getChildByName('GameInstance').boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'boxDestroyed')' in this line: 'self.parent.boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in this line: 'self.parent.parent.boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'boxDestroyed')' in this line: 'self.parent.boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in this line: 'self.parent.parent.boxDestroyed = true;' Line Number: 53
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'boxDestroyed')' in this line: 'self.parent.boxDestroyed = true;' Line Number: 53
User prompt
Add selfboxdestroy true in box class when box is destroyes
User prompt
On tick check self.boxdestroyes
User prompt
Fix Bug: 'Uncaught ReferenceError: box is not defined' in this line: 'messageDisplay.x = box.x;' Line Number: 153
User prompt
Fix Bug: 'Uncaught ReferenceError: box is not defined' in this line: 'box.x = 2048 / 2;' Line Number: 149
User prompt
Create a box variable in game
User prompt
Fix Bug: 'Uncaught ReferenceError: box is not defined' in this line: 'messageDisplay.y = box.y - 800;' Line Number: 156
User prompt
Fix Bug: 'Uncaught ReferenceError: box is not defined' in this line: 'messageDisplay.x = box.x;' Line Number: 155
User prompt
Fix Bug: 'Uncaught ReferenceError: box is not defined' in this line: 'box.x = 2048 / 2;' Line Number: 151
===================================================================
--- original.js
+++ change.js
@@ -21,10 +21,11 @@
self.removeChild(messageAsset);
messageAsset = self.createAsset(newAssetId, newDescription, 0.5, 0.5);
};
});
-var Box = Container.expand(function () {
+var Box = Container.expand(function (game) {
var self = Container.call(this);
+ self.game = game;
self.on('down', function (obj) {
startPos = obj.event.getLocalPosition(self.parent);
var currentTime = Date.now();
if (currentTime - lastClickTime < 300) {
@@ -49,9 +50,9 @@
piece.y = self.y;
self.parent.addChild(piece);
}
self.destroy();
- self.parent.setBoxDestroyed(true);
+ self.game.setBoxDestroyed(true);
LK.setTimeout(function () {
LK.showGameOver();
}, 4000);
}
@@ -125,8 +126,9 @@
});
});
var Kitty = Container.expand(function () {
var self = Container.call(this);
+ self.game = this;
var isKittyVisible = Math.random() < 0.5;
var kittyGraphics = self.createAsset(isKittyVisible ? 'kitty' : 'nokitty', isKittyVisible ? 'Kitty Graphics' : 'No Kitty Graphics', .5, .5);
if (!isKittyVisible) {
var shadowGraphics = self.createAsset('shadow', 'Shadow Graphics', .5, 1);
@@ -159,9 +161,9 @@
var kitty = self.addChild(new Kitty());
var messageDisplay = self.addChild(new MessageDisplay('yesorno', 'Yes or No Display'));
var yesMessageDisplay = self.addChild(new MessageDisplay('yes', 'Yes Display'));
var noMessageDisplay = self.addChild(new MessageDisplay('no', 'No Display'));
- self.box = self.addChild(new Box());
+ self.box = self.addChild(new Box(self));
noMessageDisplay.x = 2048 / 2;
noMessageDisplay.y = 2732 / 2 + 900;
yesMessageDisplay.x = 2048 / 2;
yesMessageDisplay.y = 2732 / 2 + 700;
8-bit. cartoon. red button. do not touch! Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. cartoon. black tub stopper with chain. in game asset.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. cartoon. axe. in game asset. no shadow.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Break in case of emergency square. Ax drawing inside. simple. 8-bit. cartoon. blackand white.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Delete