Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'setKittyVisible')' in this line: 'game.setKittyVisible(false);' Line Number: 138
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'setKittyVisible')' in this line: 'self.game.setKittyVisible(false);' Line Number: 137
User prompt
Fix Bug: 'Uncaught TypeError: self.game.setKittyVisible is not a function' in this line: 'self.game.setKittyVisible(false);' Line Number: 137
User prompt
Fix Bug: 'Uncaught TypeError: self.game.setKittyVisible is not a function' in this line: 'self.game.setKittyVisible(true);' Line Number: 139
User prompt
Fix Bug: 'Uncaught TypeError: self.game.isKittyVisible is not a function' in this line: 'self.game.isKittyVisible(false);' Line Number: 137
User prompt
Fix Bug: 'Uncaught TypeError: self.game.kittyVisible is not a function' in this line: 'self.game.kittyVisible(true);' Line Number: 139
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: self.game.isKittyVisible is not a function' in this line: 'self.game.isKittyVisible(true);' Line Number: 139
Code edit (12 edits merged)
Please save this source code
User prompt
Fix Bug: 'kitty is not defined' in this line: 'kitty.x = 2048 / 2;' Line Number: 157
User prompt
Fix Bug: 'Uncaught ReferenceError: kitty is not defined' in this line: 'kitty.x = 2048 / 2;' Line Number: 157
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- 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