User prompt
add a tick event that check if box is destroyed
User prompt
Fix Bug: 'ReferenceError: kitty is not defined' in this line: 'if (!kitty.visible) {' Line Number: 52
User prompt
nokitty should move like a ghost after box is destroyed
User prompt
increase swipe accross threshold by 400 pixels
User prompt
swipe should start in a position x smaller than 300 and should end in a position of x bigger than 1300
User prompt
if swipeaccrosbox then add slice effect to box. cut it in two piece
User prompt
add a new movement without changing the current behavior. if player swipes from outside the box to a position on the other side of the box, destroy the box
User prompt
add slice option to destroy the box. slice should cover all the width of the box
User prompt
only rotate box if it starts moving
User prompt
dont start rotating the box on click
User prompt
add a little rotation on the box after swipe
User prompt
reduce box speed on swipe by 200%
User prompt
show movement of the box after swipe. should be very slow
User prompt
swipe speed should be 500 pixels per second
User prompt
box should not move on swipe, but it should move towards the swipe direction when touch is up
User prompt
Fix Bug: 'TypeError: Cannot read properties of null (reading 'x')' in this line: 'self.velocity.x = currentPos.x - startPos.x;' Line Number: 64
User prompt
allow swipe to move box out of the screen. keep double click for destroy too.
User prompt
box should not move on drag, it should only be swipped.
Code edit (1 edits merged)
Please save this source code
User prompt
if box is out of the screen, destroy it.
Code edit (1 edits merged)
Please save this source code
User prompt
double speed of boxpieces
Code edit (1 edits merged)
Please save this source code
User prompt
3 seconds after box is destroyed reset game
User prompt
on down prevent box from moving, but allow swipe.
===================================================================
--- original.js
+++ change.js
@@ -48,14 +48,8 @@
piece.x = self.x;
piece.y = self.y;
self.parent.addChild(piece);
}
- if (!self.parent.kitty.visible) {
- var ghostKitty = new GhostKitty();
- ghostKitty.x = self.x;
- ghostKitty.y = self.y;
- self.parent.addChild(ghostKitty);
- }
self.destroy();
LK.setTimeout(function () {
LK.showGameOver();
}, 4000);
@@ -113,44 +107,37 @@
y: 0
};
self.rotationSpeed = 0;
LK.on('tick', function () {
- 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.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.boxDestroyed = true;
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 4000);
+ }
}
- if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) {
- self.destroy();
- LK.setTimeout(function () {
- LK.showGameOver();
- }, 4000);
- }
});
});
-var GhostKitty = Container.expand(function () {
- var self = Container.call(this);
- var kittyGraphics = self.createAsset('nokitty', 'Ghost Kitty Graphics', .5, .5);
- var shadowGraphics = self.createAsset('shadow', 'Shadow Graphics', .5, 1);
- self.addChildAt(shadowGraphics, 0);
- shadowGraphics.y = kittyGraphics.height / 2 + 20;
- LK.on('tick', function () {
- self.x += Math.sin(LK.ticks / 60) * 5;
- self.y += Math.cos(LK.ticks / 60) * 5;
- });
-});
var Kitty = Container.expand(function () {
var self = Container.call(this);
var isKittyVisible = Math.random() < 0.5;
var kittyGraphics = self.createAsset(isKittyVisible ? 'kitty' : 'nokitty', isKittyVisible ? 'Kitty Graphics' : 'No Kitty Graphics', .5, .5);
if (!isKittyVisible) {
- self.visible = false;
+ var shadowGraphics = self.createAsset('shadow', 'Shadow Graphics', .5, 1);
+ self.addChildAt(shadowGraphics, 0);
+ shadowGraphics.y = kittyGraphics.height / 2 + 20;
}
});
var Game = Container.expand(function () {
var self = Container.call(this);
LK.stageContainer.setBackgroundColor(0x000000);
- self.kitty = self.addChild(new Kitty());
+ 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'));
var box = self.addChild(new Box());
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