Code edit (1 edits merged)
Please save this source code
User prompt
move shadow 100 pixes down
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'worldTransform')' in this line: 'var currentY = obj.event.getLocalPosition(self.parent).y;' Line Number: 24
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in this line: 'if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732 || self.game.axe.intersects(self)) {' Line Number: 180
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in this line: 'if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732 || self.game.axe.intersects(self)) {' Line Number: 180
User prompt
Add collision check berween axe and box
User prompt
Allow drag on axe
User prompt
Spawn axe in the bottom right corner
User prompt
Add a new class named axe
User prompt
move bottom message 50 pixels up
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'LK.gui.bottomCenter.addChild(bottomMessage);' Line Number: 293
User prompt
add a text message on the bottom of the screen whenthe box is destroyed
User prompt
add message in screen in the bottom after box is destroyed
Code edit (1 edits merged)
Please save this source code
User prompt
box should be sliced also when the swipe starts outside of the box area
Code edit (1 edits merged)
Please save this source code
User prompt
when box is swiped it should slowly rotate
Code edit (1 edits merged)
Please save this source code
User prompt
slice box pieces should have different rotation speed than double click ones
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
decrease the rotation speed of box when destroyed on slice
Code edit (6 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1,319 +1,387 @@
-var Axe = Container.expand(function (assetId) {
+var Shadow = Container.expand(function () {
var self = Container.call(this);
- var axeGraphics = self.createAsset(assetId, 'Axe Graphics', 0.5, 0.5);
- var dragNode = null;
+ var shadowGraphics = self.createAsset('shadow', 'Shadow Graphics', 0.5, 0.5);
+});
+var BoxPiece = Container.expand(function () {
+ var self = Container.call(this);
+ var boxPieceGraphics = self.createAsset('boxPiece', 'Box Piece Graphics', 0.5, 0.5);
+ self.velocityX = (Math.random() - 0.5) * 10;
+ self.velocityY = (Math.random() - 0.5) * 10;
+ LK.on('tick', function () {
+ self.x += self.velocityX;
+ self.y += self.velocityY;
+ });
+});
+var Cap = Container.expand(function () {
+ var self = Container.call(this);
+ var capGraphics = self.createAsset('cap', 'Cap Graphics', 0.5, 0.5);
+ var startY;
+ var isSwipingUp = false;
self.on('down', function (obj) {
- if (obj && obj.event) {
- dragNode = self;
- }
+ startY = obj.event.getLocalPosition(self.parent).y;
});
self.on('move', function (obj) {
- if (dragNode && obj && obj.event) {
- var pos = obj.event.getLocalPosition(self.parent);
- dragNode.x = pos.x;
- dragNode.y = pos.y;
+ var currentY = obj.event.getLocalPosition(self.parent).y;
+ if (startY - currentY > 50) {
+ isSwipingUp = true;
}
});
self.on('up', function (obj) {
- dragNode = null;
+ if (isSwipingUp) {
+ console.log('Cap swiped up');
+ self.emit('swipeUp');
+ self.moveUp = true;
+ isSwipingUp = false;
+ }
});
+ LK.on('tick', function () {
+ if (self.moveUp) {
+ self.y -= 10;
+ self.x -= 10;
+ if (self.y <= self.startY - 400) {
+ self.moveUp = false;
+ }
+ }
+ });
});
-var Shadow = Container.expand(function (assetId) {
+var RedButton = Container.expand(function () {
var self = Container.call(this);
- var shadowGraphics = self.createAsset(assetId, 'Shadow Graphics', .5, .5);
+ var buttonGraphics = self.createAsset('redbutton', 'Red Button Graphics', 0.5, 0.5);
});
-var BoxPiece = Container.expand(function (assetId, direction) {
+var AxeLayers = Container.expand(function () {
var self = Container.call(this);
- LK.on('tick', function () {
- self.x += self.direction.x * 10;
- self.y += self.direction.y * 10;
- pieceGraphics.rotation += 0.05;
+ var lastTapTime = 0;
+ self.on('down', function (obj) {
+ var currentTime = Date.now();
+ var tapLength = currentTime - lastTapTime;
+ if (tapLength < 500 && tapLength > 0) {
+ if (self.children.length > 0) {
+ self.removeChildAt(self.children.length - 1);
+ }
+ if (self.children.length === 0) {
+ self.destroy();
+ }
+ }
+ lastTapTime = currentTime;
});
- var pieceGraphics = self.createAsset(assetId, 'Box Piece Graphics', 0.5, 0.5);
- self.direction = direction;
+ var layer1 = self.createAsset('layer1', 'Axe Layer 1 Graphics', 0.5, 0.5);
+ var layer2 = self.createAsset('layer2', 'Axe Layer 2 Graphics', 0.5, 0.5);
+ var layer3 = self.createAsset('layer3', 'Axe Layer 3 Graphics', 0.5, 0.5);
+ var layer4 = self.createAsset('layer4', 'Axe Layer 4 Graphics', 0.5, 0.5);
});
-var MessageDisplay = Container.expand(function (assetId, description) {
+var Box = Container.expand(function () {
var self = Container.call(this);
- self.shouldMoveUp = false;
- var messageAsset = self.createAsset(assetId, description, 0.5, 0.5);
- self.show = function () {
- self.visible = true;
+ self.spinAndShrink = function () {
+ var frames = 60;
+ var frameCounter = 0;
+ var animationTick = function () {
+ self.scale.x -= 1 / frames;
+ self.scale.y -= 1 / frames;
+ self.rotation += 0.1;
+ frameCounter++;
+ if (frameCounter >= frames) {
+ LK.off('tick', animationTick);
+ self.destroy();
+ }
+ };
+ LK.on('tick', animationTick);
};
- self.hide = function () {
- self.visible = false;
+ self.explode = function () {
+ for (var i = 0; i < 10; i++) {
+ var piece = new BoxPiece();
+ piece.x = self.x;
+ piece.y = self.y;
+ if (self.parent) {
+ self.parent.addChild(piece);
+ }
+ }
+ self.destroy();
};
- self.setMessage = function (newAssetId, newDescription) {
- self.removeChild(messageAsset);
- messageAsset = self.createAsset(newAssetId, newDescription, 0.5, 0.5);
- };
LK.on('tick', function () {
- if (self.shouldMoveUp) {
- self.y -= 2;
- if (self.y < 300) {
- self.shouldMoveUp = false;
- }
+ if (self.velocityY !== 0) {
+ self.y += self.velocityY;
}
});
+ self.velocityY = 0;
+ var boxGraphics = self.createAsset('box', 'Box Graphics', 0.5, 0.5);
+ self.enlargeBox = function () {
+ var frames = 0;
+ var animationTick = function () {
+ self.scale.x += 0.01;
+ self.scale.y += 0.01;
+ frames++;
+ if (self.width >= LK.stage.width || self.height >= LK.stage.height) {
+ LK.off('tick', animationTick);
+ self.destroy();
+ }
+ };
+ LK.on('tick', animationTick);
+ };
+ var lastTapTime = 0;
+ var tapCount = 0;
+ self.isDoubleClicked = false;
+ var startY;
+ var isSwipingUp = false;
self.on('down', function (obj) {
- if (obj && obj.event && self.parent) {
- self.startPos = obj.event.getLocalPosition(self.parent);
+ var currentTime = Date.now();
+ if (currentTime - lastTapTime < 300) {
+ tapCount++;
+ if (tapCount === 2) {
+ console.log('Box double clicked');
+ self.isDoubleClicked = true;
+ tapCount = 0;
+ }
+ } else {
+ tapCount = 1;
}
+ lastTapTime = currentTime;
+ this.startPos = obj.event.getLocalPosition(self.parent);
+ startY = this.startPos.y;
});
+ self.on('move', function (obj) {
+ var currentY = obj.event.getLocalPosition(self.parent).y;
+ if (startY - currentY > 50) {
+ isSwipingUp = true;
+ }
+ });
self.on('up', function (obj) {
- if (obj && obj.event && self.parent) {
- var endPos = obj.event.getLocalPosition(self.parent);
+ if (isSwipingUp) {
+ console.log('Box swiped up');
+ self.emit('swipeUp');
+ self.velocityY = -30;
+ isSwipingUp = false;
}
- if (this.startPos && this.startPos.y > endPos.y && Math.abs(this.startPos.y - endPos.y) > 100) {
- self.shouldMoveUp = true;
- }
});
});
-var Box = Container.expand(function (game) {
+var Axe = Container.expand(function () {
var self = Container.call(this);
- self.game = game;
+ var axeGraphics = self.createAsset('axe', 'Axe Graphics', 0.5, 0.5);
+ self.rotationSpeed = 0.05;
+ var dragNode = null;
+ var startDragPos = null;
self.on('down', function (obj) {
- if (obj && obj.event) {
- if (obj && obj.event && self.parent) {
- if (self.parent) {
- this.startPos = obj.event.getLocalPosition(self.parent);
- }
- }
+ dragNode = self;
+ startDragPos = obj.event.getLocalPosition(self.parent);
+ });
+ self.on('move', function (obj) {
+ if (dragNode) {
+ var currentPos = obj.event.getLocalPosition(self.parent);
+ dragNode.x = currentPos.x - axeGraphics.width / 2;
+ dragNode.y = currentPos.y - axeGraphics.height / 2;
}
- var currentTime = Date.now();
- if (currentTime - lastClickTime < 300) {
- clickCount++;
- if (clickCount === 2) {
- var directions = [{
- x: -1,
- y: -1
- }, {
- x: 1,
- y: -1
- }, {
- x: -1,
- y: 1
- }, {
- x: 1,
- y: 1
- }];
- for (var i = 0; i < 4; i++) {
- var piece = new BoxPiece('boxPiece' + (i + 1), directions[i]);
- piece.x = self.x;
- piece.y = self.y;
- self.parent.addChild(piece);
- }
- self.destroy();
- console.log('Box explode on double click');
- self.game.setBoxDestroyed(true);
- LK.setTimeout(function () {
- LK.showGameOver();
- }, 4000);
- }
- } else {
- clickCount = 1;
- }
- lastClickTime = currentTime;
});
self.on('up', function (obj) {
- if (obj && obj.event && self.parent) {
- var endPos = obj.event.getLocalPosition(self.parent);
+ dragNode = null;
+ });
+ LK.on('tick', function () {
+ self.rotation += self.rotationSpeed;
+ });
+});
+var DeadoraliveMessage = Container.expand(function () {
+ var self = Container.call(this);
+ var messageGraphics = self.createAsset('deadoralive', 'Deadoralive Graphics', 0.5, 0.5);
+ var startY;
+ var targetY;
+ var isSwiping = false;
+ self.on('down', function (obj) {
+ startY = obj.event.getLocalPosition(self.parent).y;
+ targetY = self.y - 300;
+ });
+ self.on('move', function (obj) {
+ var currentY = obj.event.getLocalPosition(LK.stageContainer).y;
+ if (startY - currentY > 20) {
+ isSwiping = true;
}
- var swipeAcrossBox = this.startPos.x < self.x - 200 && endPos.x > self.x + 200;
- if (swipeAcrossBox) {
- var topPiece = new BoxPiece('boxTop', {
- x: 0,
- y: -1
+ });
+ self.on('up', function (obj) {
+ if (isSwiping) {
+ LK.on('tick', function () {
+ if (self.y > targetY) {
+ self.y -= 5;
+ if (self.y < targetY) {
+ self.y = targetY;
+ LK.off('tick');
+ }
+ }
});
- var bottomPiece = new BoxPiece('boxBottom', {
- x: 0,
- y: 1
- });
- topPiece.x = self.x;
- topPiece.y = self.y - self.height / 4;
- bottomPiece.x = self.x;
- bottomPiece.y = self.y + self.height / 4;
- self.parent.addChild(topPiece);
- self.parent.addChild(bottomPiece);
- self.destroy();
- console.log('Box explode on slice');
- self.game.setBoxDestroyed(true);
- LK.setTimeout(function () {
- LK.showGameOver();
- }, 4000);
- } else {
- self.velocity.x = endPos.x - this.startPos.x;
- self.velocity.y = endPos.y - this.startPos.y;
- self.direction.x = self.velocity.x > 0 ? 1 : -1;
- self.direction.y = self.velocity.y > 0 ? 1 : -1;
- self.velocity.x = Math.abs(self.velocity.x) > 5 ? 25 * self.direction.x : 0;
- self.velocity.y = Math.abs(self.velocity.y) > 5 ? 25 * self.direction.y : 0;
- self.rotationSpeed = 0.1 * self.direction.x;
}
+ isSwiping = false;
});
- var boxGraphics = self.createAsset('box', 'Box Graphics', .5, .5);
- var clickCount = 0;
- var lastClickTime = 0;
- this.startPos = {
- x: 0,
- y: 0
+});
+var DeadMessage = Container.expand(function () {
+ var self = Container.call(this);
+ var messageGraphics = self.createAsset('deadmessage', 'Dead Graphics', 0.5, 0.5);
+});
+var AliveMessage = Container.expand(function () {
+ var self = Container.call(this);
+ var messageGraphics = self.createAsset('alivemessage', 'Alive Graphics', 0.5, 0.5);
+});
+var Kitty = Container.expand(function () {
+ var self = Container.call(this);
+ self.isDead = false;
+ self.alpha = 1;
+ var ghostlyMovement = function () {
+ self.y += Math.sin(LK.ticks / 10) * 1;
};
+ LK.on('tick', ghostlyMovement);
+ var deadkitty = self.createAsset('dead', 'Dead Kitty Graphics', 0.5, 0.5);
+ var kitty = self.createAsset('alive', 'Kitty Graphics', 0.5, 0.5);
+});
+var DeadKitty = Container.expand(function () {
+ var self = Container.call(this);
+ self.alpha = 0.5;
+ var ghostlyMovement = function () {
+ self.y += Math.sin(LK.ticks / 10) * 0.5;
+ };
+ LK.on('tick', ghostlyMovement);
+ var deadkitty = self.createAsset('dead', 'Dead Kitty Graphics', 0.5, 0.5);
+});
+var Lid = Container.expand(function () {
+ var self = Container.call(this);
+ var lidGraphics = self.createAsset('lid', 'Lid Graphics', 0.5, 0.5);
+ var dragNode = null;
+ var startDragPos = null;
self.on('down', function (obj) {
- if (obj && obj.event && self.parent) {
- this.startPos = obj.event.getLocalPosition(self.parent);
- }
+ dragNode = self;
+ startDragPos = obj.event.getLocalPosition(self.parent);
});
- self.velocity = {
- x: 0,
- y: 0
- };
- self.direction = {
- x: 0,
- y: 0
- };
- LK.on('tick', function () {
- if (!self.game.boxDestroyed) {
- self.x += self.velocity.x * (125 / 60);
- self.y += self.velocity.y * (125 / 60);
- if (self.velocity.x !== 0 || self.velocity.y !== 0) {
- self.rotation += self.rotationSpeed;
- }
- if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732 || self.game.axe && self.game.axe.intersects(self)) {
- self.destroy();
- console.log('Box explode on swipe or collision with axe');
- self.game.setBoxDestroyed(true);
- LK.setTimeout(function () {
- LK.showGameOver();
- }, 4000);
- }
+ self.on('move', function (obj) {
+ if (dragNode) {
+ var currentPos = obj.event.getLocalPosition(self.parent);
+ dragNode.x = currentPos.x - lidGraphics.width / 2;
+ dragNode.y = currentPos.y - lidGraphics.height / 2;
}
});
+ self.on('up', function (obj) {
+ dragNode = null;
+ });
});
-var Kitty = Container.expand(function (game) {
- var self = Container.call(this);
- self.game = game;
- var isKittyVisible = Math.random() < 0.5;
- var kittyGraphics = self.createAsset(isKittyVisible ? 'kitty' : 'nokitty', isKittyVisible ? 'Kitty Graphics' : 'No Kitty Graphics', .5, .5);
- self.game.isKittyVisible = isKittyVisible;
- if (isKittyVisible) {
- self.jumpMovement = {
- x: 0,
- y: 0,
- jumpHeight: 10,
- jumping: false
- };
- LK.on('tick', function () {
- if (self.game.boxDestroyed) {
- if (!self.jumpMovement.jumping) {
- self.jumpMovement.jumping = true;
- self.jumpMovement.y = -self.jumpMovement.jumpHeight;
- }
- self.jumpMovement.y += 0.4;
- if (self.jumpMovement.y > self.jumpMovement.jumpHeight) {
- self.jumpMovement.jumping = false;
- }
- self.x += self.jumpMovement.x;
- self.y += self.jumpMovement.y;
- }
- });
- } else {
- self.ghostyMovement = {
- x: 0,
- y: -0.5
- };
- var moveUp = true;
- var moveStartTime = LK.ticks;
- LK.on('tick', function () {
- if (self.game.boxDestroyed) {
- if (moveUp && LK.ticks - moveStartTime > 90) {
- moveUp = false;
- self.ghostyMovement.y = 0.5;
- } else if (!moveUp && LK.ticks - moveStartTime > 180) {
- moveUp = true;
- self.ghostyMovement.y = -0.5;
- moveStartTime = LK.ticks;
- }
- self.x += self.ghostyMovement.x;
- self.y += self.ghostyMovement.y;
- if (self.y < 0) {
- self.y = 2732;
- } else if (self.y > 2732) {
- self.y = 0;
- }
- }
- });
- }
-});
var Game = Container.expand(function () {
var self = Container.call(this);
- var axe = self.addChild(new Axe('axe'));
- axe.x = 2048 - axe.width / 2;
- axe.y = 2732 - axe.height / 2;
- LK.stageContainer.setBackgroundColor(0x000000);
- this.isKittyVisible = false;
- this.boxDestroyed = false;
- var shadow = self.addChild(new Shadow('shadow'));
- shadow.x = 2048 / 2;
- shadow.y = 2732 / 2 + 300;
- var redbutton = self.createAsset('redbutton', 'Red Button Graphics', 0.5, 0.5);
+ var messageText = new Text2('Game Start', {
+ size: 40,
+ fill: '#ffffff'
+ });
+ messageText.anchor.set(.5, .5);
+ messageText.y += 1600;
+ LK.gui.topCenter.addChild(messageText);
+ var kitty = self.addChild(new Kitty());
+ self.isDead = Math.random() < 0.5;
+ kitty.x = LK.stage.width / 2;
+ kitty.y = LK.stage.height / 2;
+ var shadow = self.addChild(new Shadow());
+ shadow.x = kitty.x;
+ shadow.y = kitty.y + 50;
+ var deadkitty = self.addChild(new DeadKitty());
+ deadkitty.x = LK.stage.width / 2;
+ deadkitty.y = LK.stage.height / 2;
+ var deadoralivemessage = self.addChild(new DeadoraliveMessage());
+ deadoralivemessage.x = LK.stage.width / 2;
+ deadoralivemessage.y = 600;
+ var cap = self.addChild(new Cap());
+ cap.x = 300;
+ cap.y = 2400;
+ var lid = self.addChild(new Lid());
+ lid.x = cap.x;
+ lid.y = cap.y;
+ var redbutton = self.addChild(new RedButton());
+ redbutton.x = deadoralivemessage.x;
+ redbutton.y = deadoralivemessage.y;
redbutton.on('down', function () {
- var growInterval = LK.setInterval(function () {
- self.box.scale.x += 0.05;
- self.box.scale.y += 0.05;
- if (self.box.width >= 2048 || self.box.height >= 2732) {
- LK.clearInterval(growInterval);
- self.box.destroy();
- console.log('Red button touched, box destroyed');
- self.setBoxDestroyed(true);
+ redbutton.isTouched = true;
+ });
+ var deadoralivemessage = self.addChild(new DeadoraliveMessage());
+ deadoralivemessage.x = LK.stage.width / 2;
+ deadoralivemessage.y = 600;
+ var deadMessage = self.addChild(new DeadMessage());
+ deadMessage.x = LK.stage.width / 2;
+ deadMessage.y = LK.stage.height - 700 - deadMessage.height / 2;
+ deadMessage.visible = false;
+ var aliveMessage = self.addChild(new AliveMessage());
+ aliveMessage.x = LK.stage.width / 2;
+ aliveMessage.y = LK.stage.height - 700 - aliveMessage.height / 2;
+ aliveMessage.visible = false;
+ var box = self.addChild(new Box());
+ box.x = LK.stage.width / 2;
+ box.y = LK.stage.height / 2;
+ var axe = self.addChild(new Axe());
+ var axeLayers = self.addChild(new AxeLayers());
+ axeLayers.x = axe.x = LK.stage.width - axe.width / 2 - 100;
+ axeLayers.y = axe.y = LK.stage.height - axe.height / 2 - 100;
+ axeLayers.zIndex = axe.zIndex + 1;
+ if (self.isDead) {
+ kitty.visible = false;
+ } else {
+ deadkitty.visible = false;
+ }
+ LK.on('tick', function () {
+ if (redbutton.isTouched) {
+ messageText.setText('(BOOOM! Nice one...still more to find...)');
+ if (box) {
+ box.enlargeBox();
+ box = null;
LK.setTimeout(function () {
+ if (self.isDead) {
+ deadMessage.visible = true;
+ } else {
+ aliveMessage.visible = true;
+ }
+ }, 3000);
+ LK.setTimeout(function () {
LK.showGameOver();
- }, 4000);
+ }, 7000);
}
- }, 16.6667);
- });
- var messageDisplay = self.addChild(new MessageDisplay('yesorno', 'Yes or No Display'));
- var noMessageDisplay = self.addChild(new MessageDisplay('no', 'No Display'));
- var yesMessageDisplay = self.addChild(new MessageDisplay('yes', 'Yes Display'));
- self.kitty = self.addChild(new Kitty(self));
- self.box = self.addChild(new Box(self));
- noMessageDisplay.x = 2048 / 2;
- noMessageDisplay.y = 2732 / 2 + 700;
- yesMessageDisplay.x = 2048 / 2;
- yesMessageDisplay.y = 2732 / 2 + 700;
- yesMessageDisplay.visible = false;
- noMessageDisplay.visible = false;
- self.kitty.x = 2048 / 2;
- self.kitty.y = 2732 / 2;
- self.box.x = 2048 / 2;
- self.box.y = 2732 / 2;
- messageDisplay.x = self.box.x;
- messageDisplay.y = self.box.y - 800;
- redbutton.x = self.box.x;
- redbutton.y = self.box.y - 800;
- messageDisplay.show();
- this.setisKittyVisible = function (value) {
- this.isKittyVisible = value;
- console.log('Inside method', self.isKittyVisible);
- };
- this.setBoxDestroyed = function (value) {
- this.boxDestroyed = value;
- if (this.boxDestroyed) {
- console.log('Inside loop', self.isKittyVisible);
- if (self.isKittyVisible) {
- console.log('Kitty is visible. Displaying yes message.');
- yesMessageDisplay.show();
+ redbutton.isTouched = false;
+ }
+ if (axe.intersects(box)) {
+ messageText.setText('(Chop chop! Is there any other way left?)');
+ box.explode();
+ if (self.isDead) {
+ deadMessage.visible = true;
} else {
- console.log('Kitty is Not Visible. Displaying No message.');
- noMessageDisplay.show();
+ aliveMessage.visible = true;
}
- var bottomMessage = new Text2('The box has been destroyed!', {
- size: 100,
- fill: '#ffffff',
- align: 'center'
- });
- bottomMessage.anchor.set(0.5, 0);
- bottomMessage.x = 2048 / 2;
- bottomMessage.y = 2732 - 150;
- self.addChild(bottomMessage);
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 5000);
}
- };
+ if (box && box.isDoubleClicked) {
+ messageText.setText('(Double clicked...how original! You can do better...)');
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 5000);
+ box.destroy();
+ box = null;
+ if (self.isDead) {
+ deadMessage.visible = true;
+ } else {
+ aliveMessage.visible = true;
+ }
+ }
+ if (box && cap.x < 1) {
+ box.spinAndShrink();
+ messageText.setText('(Down the drain it goes! I bet you can find another way...)');
+ box = null;
+ if (self.isDead) {
+ deadMessage.visible = true;
+ } else {
+ aliveMessage.visible = true;
+ }
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 5000);
+ }
+ if (box && (box.y + box.height < 0 || box.y > LK.stage.height || cap.y + cap.height < 0 || cap.y > LK.stage.height || cap.x < 1)) {
+ messageText.setText('(Swipe up, classic...Any other ideas?)');
+ box = null;
+ if (self.isDead) {
+ deadMessage.visible = true;
+ } else {
+ aliveMessage.visible = true;
+ }
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 5000);
+ }
+ });
});
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