User prompt
decrese velocity of move for swipe for 200%
User prompt
box should not be draged, only swiped
User prompt
decrease swipe velocity 200%
User prompt
box should move on swipe at 500 pixels per second
User prompt
on tick move box on the direction of the swipe
Code edit (3 edits merged)
Please save this source code
User prompt
add swipe movement to the box keep the double click available too.
User prompt
box pieces should rotate on their axis while moving
User prompt
move box piece on tick
User prompt
add move to boxpieces
User prompt
on destroy make box asset cut itself in 4 cuadrants and each piece should move towards the corners of the screen
User prompt
add yeskitty jump movement every 1 second
User prompt
make nokitty move like a floating ghost
User prompt
Fix Bug: 'Uncaught ReferenceError: messageDisplay is not defined' in this line: 'messageDisplay.x = box.x;' Line Number: 68
User prompt
Fix Bug: 'ReferenceError: yesMessageDisplay is not defined' in this line: 'yesMessageDisplay.visible = false;' Line Number: 34
User prompt
on box destroy check iskittyvisible. if is kittyvisible then set yesmessagedisplay to true. if not, set nomessagedisplay to true.
User prompt
log yesmessagedisplay value in console
User prompt
Fix Bug: 'ReferenceError: kitty is not defined' in this line: 'if (kitty.isKittyVisible) {' Line Number: 29
User prompt
on box destroy, if iskittyvisible true then set yesMessageDisplay.visible = true
Code edit (1 edits merged)
Please save this source code
User prompt
move kitty shadow behing asset
User prompt
add shadow below nokitty
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'on')' in this line: 'box.on('boxDestroyed', function (event) {' Line Number: 45
User prompt
Add a condition to display yesmessagedisplay after box is destroyed if iskiityvisible is true. If not display nomessagdisplay
User prompt
destroy box on doubleclikc
===================================================================
--- original.js
+++ change.js
@@ -35,11 +35,59 @@
self.direction = {
x: 0,
y: 0
};
+ self.on('down', function (obj) {
+ startPos = obj.event.getLocalPosition(self);
+ var currentTime = Date.now();
+ if (currentTime - lastClickTime < 300) {
+ clickCount++;
+ } else {
+ clickCount = 1;
+ }
+ lastClickTime = currentTime;
+ 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();
+ }
+ });
+ self.on('move', function (obj) {
+ if (startPos) {
+ var currentPos = obj.event.getLocalPosition(self);
+ var dx = currentPos.x - startPos.x;
+ var dy = currentPos.y - startPos.y;
+ self.direction = {
+ x: dx,
+ y: dy
+ };
+ self.velocity = {
+ x: dx,
+ y: dy
+ };
+ startPos = currentPos;
+ }
+ });
LK.on('tick', function () {
- self.x += self.velocity.x * (250 / 60);
- self.y += self.velocity.y * (250 / 60);
+ self.x += self.velocity.x * (125 / 60);
+ self.y += self.velocity.y * (125 / 60);
});
});
var Kitty = Container.expand(function () {
var self = Container.call(this);
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