User prompt
El perro debe ladrar más seguido y hacer un sonido
User prompt
el perro debe abrir y cerrar la boca 2 veces por segundo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Puedes implementarlo en el código del juego.
User prompt
Implementalo
User prompt
El juego debe ser más rápido y el gato cuando choca una de las barras laterales pierde la vida. Va hacia abajo de todo y pierde la vida. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
El gato debe caminar mucho más rápido, debe estar en el medio de la pantalla según el eje X y únicamente cuando choca las barreras que son las barras que bloquean el paso cae hacia abajo y pierde la vida. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
El gato al chocarse con una bateria, debe caer al fondo del juego y perder una vida ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Debe ser mas dinamico ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
La forma de vencer al perro es que el gato tumbe algo que le caiga arriba
User prompt
En el centro según x
User prompt
El gato debe estar en el centro
User prompt
El perro debe intercalar entre dog y dog close para ladrar y el gato debe tirar los objetos xuando se aprieta el boton con zarpazo
User prompt
Los separadores tienen que estar más arriba
User prompt
El gato debe estar en la mitad de la pantalla
User prompt
El gato debe sufrir y bajar las tablas si es necesario cuando sigue el punero laser
User prompt
los items estan flotando por debajo de las shelves
User prompt
el usuario debe ser quien persiga al raton, no es automatico, al encontrase con el raton, el gato lo come
User prompt
unos 18 px mas arriba
User prompt
ahora quedo por debajo
User prompt
el gato esta flotando sobre los shelves
User prompt
puedes hacer que los shelves bajen 80px de su posicion relativa
User prompt
los shelves deben estar e nla parte inferior de su box, no en el medio
Code edit (1 edits merged)
Please save this source code
Code edit (14 edits merged)
Please save this source code
User prompt
el raton queda encerrado entre los objetos
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Cat = Container.expand(function () { var self = Container.call(this); var catGraphics = self.attachAsset('cat', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2 }); self.speed = 10; // Much faster cat movement self.direction = 1; // 1 for right, -1 for left self.targetShelfLevel = 2; // Start on middle shelf (0-4) self.currentShelfLevel = 2; self.isLaserMode = false; self.laserModeTimer = 0; self.normalSpeed = 8; self.laserSpeed = 15; self.isChasing = false; self.chaseTarget = null; self.isHiding = false; self.hideTarget = null; self.isJumping = false; self.lives = 3; self.isInvulnerable = false; self.invulnerabilityTimer = 0; self.update = function () { // Move towards target shelf level with dynamic jumping animation var targetY = shelfLevels[self.targetShelfLevel] - 178; // Position to stand on shelf if (Math.abs(self.y - targetY) > 5) { // Check if we need to start a new jump animation if (!self.isJumping) { self.isJumping = true; var jumpDistance = targetY - self.y; var jumpDuration = Math.abs(jumpDistance) * 0.8; // Duration based on distance // Stop any existing tween tween.stop(self, { y: true }); // Create dynamic jump with bounce effect if (self.y < targetY) { // Jumping down - faster with slight bounce tween(self, { y: targetY }, { duration: jumpDuration, easing: tween.bounceOut, onFinish: function onFinish() { self.y = targetY; self.currentShelfLevel = self.targetShelfLevel; self.isJumping = false; } }); } else { // Jumping up - elastic effect for more dynamic feel tween(self, { y: targetY }, { duration: jumpDuration * 1.2, easing: tween.elasticOut, onFinish: function onFinish() { self.y = targetY; self.currentShelfLevel = self.targetShelfLevel; self.isJumping = false; } }); } } } else { self.y = targetY; self.currentShelfLevel = self.targetShelfLevel; self.isJumping = false; } // Handle laser mode if (self.isLaserMode) { self.laserModeTimer--; if (self.laserModeTimer <= 0) { self.isLaserMode = false; self.speed = self.normalSpeed; } else if (laserDot) { // Chase laser dot - cat will suffer and fall through shelves if necessary var deltaX = laserDot.x - self.x; var deltaY = laserDot.y - self.y; var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); if (distance > 10) { // Move directly towards laser dot, ignoring shelf constraints self.x += deltaX / distance * self.laserSpeed; self.y += deltaY / distance * self.laserSpeed; // Update direction based on movement if (deltaX > 0) { self.direction = 1; catGraphics.scaleX = 1; } else { self.direction = -1; catGraphics.scaleX = -1; } // Update target shelf level based on laser position for visual consistency // Find closest shelf level to laser dot var closestLevel = 0; var minDistance = Math.abs(laserDot.y - (shelfLevels[0] - 178)); for (var level = 1; level < 5; level++) { var levelDistance = Math.abs(laserDot.y - (shelfLevels[level] - 178)); if (levelDistance < minDistance) { minDistance = levelDistance; closestLevel = level; } } self.targetShelfLevel = closestLevel; } } } else if (self.isChasing && self.chaseTarget) { // Manual chase mode - user controls the cat, just check for collision var deltaX = self.chaseTarget.x - self.x; var deltaY = self.chaseTarget.y - self.y; var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); if (distance < 50) { // Caught the mouse! self.chaseTarget.destroy(); var mouseIndex = mice.indexOf(self.chaseTarget); if (mouseIndex > -1) { mice.splice(mouseIndex, 1); } self.isChasing = false; self.chaseTarget = null; LK.setScore(LK.getScore() + 100); scoreTxt.setText(LK.getScore()); LK.effects.flashObject(self, 0x00ff00, 500); } // No automatic movement - user must control the cat manually } else if (self.isHiding && self.hideTarget) { // Hide from dog mode - move away from dog var deltaX = self.x - self.hideTarget.x; var deltaY = self.y - self.hideTarget.y; var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); if (distance > 300) { // Safe distance from dog self.isHiding = false; self.hideTarget = null; } else { // Move away from dog var hideSpeed = 3; if (distance > 5) { self.x += deltaX / distance * hideSpeed; // Update direction based on movement if (deltaX > 0) { self.direction = 1; catGraphics.scaleX = 1; } else { self.direction = -1; catGraphics.scaleX = -1; } } // Try to move to a different shelf level var dogLevel = -1; for (var level = 0; level < 5; level++) { if (Math.abs(self.hideTarget.y - shelfLevels[level]) < 50) { dogLevel = level; break; } } if (dogLevel !== -1 && self.targetShelfLevel === dogLevel) { // Move to adjacent shelf level if (dogLevel > 0 && dogLevel < 4) { self.targetShelfLevel = Math.random() < 0.5 ? dogLevel - 1 : dogLevel + 1; } else if (dogLevel === 0) { self.targetShelfLevel = 1; } else { self.targetShelfLevel = 3; } } } } else { // Move dog with smooth tweening if (!self.isTweening) { var targetX = self.x + self.speed * self.direction * 60; // Move distance over 1 second tween(self, { x: targetX }, { duration: 1000, easing: tween.linear, onFinish: function onFinish() { self.isTweening = false; } }); self.isTweening = true; } // Update graphics direction // Change direction randomly with smooth turn animation if (self.direction > 0) { catGraphics.scaleX = 1; } else { catGraphics.scaleX = -1; } } for (var i = shelfObjects.length - 1; i >= 0; i--) { var obj = shelfObjects[i]; if (self.intersects(obj) && !obj.isFalling) { obj.startFalling(); LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); // Play random knock sound var soundId = 'knock' + (Math.floor(Math.random() * 3) + 1); LK.getSound(soundId).play(); } } // Check for collisions with dangerous objects for (var i = dangerousObjects.length - 1; i >= 0; i--) { var dangerousObj = dangerousObjects[i]; if (self.intersects(dangerousObj) && dangerousObj.isDangerous && !dangerousObj.isFalling) { // Cat falls off the shelf dangerousObj.startFalling(); LK.getSound('catFall').play(); LK.effects.flashScreen(0xff0000, 500); // Reset cat position and reduce score self.x = cameraX + 512; self.y = shelfLevels[2] - 178; self.targetShelfLevel = 2; self.currentShelfLevel = 2; LK.setScore(Math.max(0, LK.getScore() - 50)); scoreTxt.setText(LK.getScore()); } } // Check for collisions with dogs - cat can kill dog by falling on it for (var i = dogs.length - 1; i >= 0; i--) { var dog = dogs[i]; if (self.intersects(dog) && self.isJumping && self.y < dog.y - 20) { // Cat falls on dog and kills it LK.getSound('dogBark').play(); LK.effects.flashObject(self, 0x00ff00, 500); LK.setScore(LK.getScore() + 200); scoreTxt.setText(LK.getScore()); // Remove dog from game dog.destroy(); dogs.splice(i, 1); // Stop hiding behavior if this was the hide target if (dog === self.hideTarget) { self.isHiding = false; self.hideTarget = null; } } } // Check for collisions with separators for (var i = separators.length - 1; i >= 0; i--) { var separator = separators[i]; if (self.intersects(separator) && separator.isBlocking && !self.isInvulnerable) { // Cat hits separator and loses a life self.lives--; self.isInvulnerable = true; self.invulnerabilityTimer = 120; // 2 seconds of invulnerability LK.getSound('catFall').play(); LK.effects.flashScreen(0xff0000, 1000); // Dramatic fall animation tween(self, { y: 2732 + 200 // Fall off screen bottom }, { duration: 1000, easing: tween.easeIn, onFinish: function onFinish() { // Reset cat position after fall self.x = cameraX + 512; self.y = shelfLevels[2] - 178; self.targetShelfLevel = 2; self.currentShelfLevel = 2; } }); // Update lives display livesText.setText('Lives: ' + self.lives); // Check for game over if (self.lives <= 0) { LK.showGameOver(); } LK.setScore(Math.max(0, LK.getScore() - 100)); scoreTxt.setText(LK.getScore()); } } // Handle invulnerability timer if (self.isInvulnerable) { self.invulnerabilityTimer--; // Flash effect during invulnerability catGraphics.alpha = Math.sin(LK.ticks * 0.5) * 0.5 + 0.5; if (self.invulnerabilityTimer <= 0) { self.isInvulnerable = false; catGraphics.alpha = 1; } } // Check for laser pointer pickup for (var i = laserPointers.length - 1; i >= 0; i--) { var pointer = laserPointers[i]; if (self.intersects(pointer)) { self.isLaserMode = true; self.laserModeTimer = 300; // 5 seconds at 60fps self.speed = self.laserSpeed; LK.getSound('laserPickup').play(); pointer.destroy(); laserPointers.splice(i, 1); // Create laser dot if (!laserDot) { laserDot = game.addChild(LK.getAsset('laserDot', { anchorX: 0.5, anchorY: 0.5 })); } laserDot.x = self.x + 100; laserDot.y = self.y; break; } } }; return self; }); var DangerousObject = Container.expand(function () { var self = Container.call(this); var dangerousGraphics = self.attachAsset('dangerousObject', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); self.isFalling = false; self.fallSpeed = 0; self.isDangerous = true; self.pulseTimer = 0; self.startFalling = function () { self.isFalling = true; self.fallSpeed = 2; self.isDangerous = false; // Not dangerous when falling }; self.update = function () { if (!self.isFalling) { // Pulse effect to show it's dangerous self.pulseTimer++; var scale = 1 + Math.sin(self.pulseTimer * 0.15) * 0.3; dangerousGraphics.scaleX = scale; dangerousGraphics.scaleY = scale; } else { self.y += self.fallSpeed; self.fallSpeed += 0.2; // Gravity self.rotation += 0.1; if (self.y > 2732 + 50) { self.destroy(); var index = dangerousObjects.indexOf(self); if (index > -1) { dangerousObjects.splice(index, 1); } } } }; return self; }); var Dog = Container.expand(function () { var self = Container.call(this); var dogGraphics = self.attachAsset('dog', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); self.speed = 8; // Much faster dog movement self.direction = 1; self.alertRadius = 200; self.pulseTimer = 0; self.barkTimer = 0; self.isBarkingOpen = false; self.dogCloseGraphics = null; self.isTweening = false; // Flag for smooth movement self.update = function () { // Pulse effect to show dog is dangerous self.pulseTimer++; var scale = 1 + Math.sin(self.pulseTimer * 0.15) * 0.2; dogGraphics.scaleX = scale * self.direction; dogGraphics.scaleY = scale; // Move mouse with smooth tweening and dynamic scaling if (!self.isTweening) { var targetX = self.x + self.speed * self.direction * 30; // Move distance over 0.5 seconds tween(self, { x: targetX }, { duration: 500, easing: tween.easeInOut, onFinish: function onFinish() { self.isTweening = false; } }); self.isTweening = true; } // Change direction randomly // Change direction randomly or when hitting boundaries with bounce animation if (Math.random() < 0.008) { self.direction *= -1; tween(dogGraphics, { scaleX: scale * self.direction * 1.3 }, { duration: 200, easing: tween.bounceOut, onFinish: function onFinish() { tween(dogGraphics, { scaleX: scale * self.direction }, { duration: 100, easing: tween.easeOut }); } }); } // Handle barking animation - 2 times per second (every 15 ticks = 4 times per second, so every 30 ticks = 2 times per second) self.barkTimer++; if (self.barkTimer >= 30) { // Change every 0.5 seconds (30 ticks) for 2 times per second self.barkTimer = 0; if (self.isBarkingOpen) { // Switch to normal dog with smooth tween tween(dogGraphics, { alpha: 1 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { dogGraphics.visible = true; if (self.dogCloseGraphics) { self.dogCloseGraphics.visible = false; } self.isBarkingOpen = false; } }); } else { // Switch to barking dog (close mouth) with smooth tween if (!self.dogCloseGraphics) { self.dogCloseGraphics = self.attachAsset('Dog-close', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); } tween(self.dogCloseGraphics, { alpha: 1 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { dogGraphics.visible = false; self.dogCloseGraphics.visible = true; self.dogCloseGraphics.scaleX = scale * self.direction; self.dogCloseGraphics.scaleY = scale; self.isBarkingOpen = true; } }); } } // Sync dog-close graphics scale with regular graphics if (self.dogCloseGraphics && self.dogCloseGraphics.visible) { self.dogCloseGraphics.scaleX = scale * self.direction; self.dogCloseGraphics.scaleY = scale; } // Check if cat is within alert radius var distance = Math.abs(self.x - cat.x) + Math.abs(self.y - cat.y); if (distance < self.alertRadius) { cat.isHiding = true; cat.hideTarget = self; if (Math.random() < 0.08) { // Increased from 0.02 to 0.08 for more frequent barking LK.getSound('dogBark').play(); } } // Additional barking when mouth opens (barking animation) if (self.barkTimer === 0 && !self.isBarkingOpen && Math.random() < 0.7) { // 70% chance to bark when switching to open mouth LK.getSound('dogBark').play(); } }; return self; }); var LaserPointer = Container.expand(function () { var self = Container.call(this); var pointerGraphics = self.attachAsset('laserPointer', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); self.pulseTimer = 0; self.update = function () { self.pulseTimer++; // Dynamic pulsing with tween animation if (self.pulseTimer % 120 === 0) { // Every 2 seconds tween(pointerGraphics, { scaleX: 6, scaleY: 6 }, { duration: 600, easing: tween.elasticOut, onFinish: function onFinish() { tween(pointerGraphics, { scaleX: 4, scaleY: 4 }, { duration: 400, easing: tween.bounceOut }); } }); } // Add rotation animation for more visual appeal tween(pointerGraphics, { rotation: pointerGraphics.rotation + Math.PI * 2 }, { duration: 3000, easing: tween.linear }); }; return self; }); var Mouse = Container.expand(function () { var self = Container.call(this); var mouseGraphics = self.attachAsset('mouse', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); self.speed = 12; // Much faster mouse movement self.direction = 1; self.isBeingChased = false; self.pulseTimer = 0; self.isTweening = false; // Flag for smooth movement self.update = function () { // Pulse effect to make mouse visible self.pulseTimer++; var scale = 1 + Math.sin(self.pulseTimer * 0.2) * 0.3; mouseGraphics.scaleX = scale * self.direction; mouseGraphics.scaleY = scale; // Move mouse self.x += self.speed * self.direction; // Change direction randomly or when hitting boundaries if (Math.random() < 0.01 || self.x < cat.x - 600 || self.x > cat.x + 600) { self.direction *= -1; // Add dynamic bounce effect when changing direction tween(mouseGraphics, { scaleX: scale * self.direction * 1.5, scaleY: scale * 1.2 }, { duration: 300, easing: tween.elasticOut, onFinish: function onFinish() { tween(mouseGraphics, { scaleX: scale * self.direction, scaleY: scale }, { duration: 200, easing: tween.easeOut }); } }); } // Mouse squeaks when cat gets close, but doesn't trigger automatic chase var distance = Math.abs(self.x - cat.x) + Math.abs(self.y - cat.y); if (distance < 100 && !self.isBeingChased) { self.isBeingChased = true; // Set the cat's chase target but don't enable automatic chasing cat.chaseTarget = self; LK.getSound('mouseSqueak').play(); } }; return self; }); var Separator = Container.expand(function () { var self = Container.call(this); var separatorGraphics = self.attachAsset('separator', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); self.isBlocking = true; return self; }); var ShelfObject = Container.expand(function (objectType) { var self = Container.call(this); var assetName = 'object' + (objectType || 1); var objectGraphics = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); self.isFalling = false; self.fallSpeed = 0; self.startFalling = function () { self.isFalling = true; self.fallSpeed = 2; // Add dynamic falling animation with scaling and rotation tween(objectGraphics, { scaleX: 6, scaleY: 6 }, { duration: 800, easing: tween.bounceOut }); // Add spinning effect while falling var spinDirection = Math.random() < 0.5 ? 1 : -1; tween(self, { rotation: self.rotation + Math.PI * 4 * spinDirection }, { duration: 2000, easing: tween.easeOut }); }; self.update = function () { if (self.isFalling) { self.y += self.fallSpeed; self.fallSpeed += 0.2; // Gravity self.rotation += 0.1; // Check for collisions with dogs when falling for (var i = dogs.length - 1; i >= 0; i--) { var dog = dogs[i]; if (self.intersects(dog)) { // Object hits dog and defeats it LK.getSound('dogBark').play(); LK.effects.flashObject(dog, 0xff0000, 500); LK.setScore(LK.getScore() + 200); scoreTxt.setText(LK.getScore()); // Remove dog from game dog.destroy(); dogs.splice(i, 1); // Stop hiding behavior if this was the hide target if (dog === cat.hideTarget) { cat.isHiding = false; cat.hideTarget = null; } // Remove the object that hit the dog self.destroy(); var index = shelfObjects.indexOf(self); if (index > -1) { shelfObjects.splice(index, 1); } return; // Exit early since object is destroyed } } if (self.y > 2732 + 50) { self.destroy(); var index = shelfObjects.indexOf(self); if (index > -1) { shelfObjects.splice(index, 1); } } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var cat; var shelfObjects = []; var dangerousObjects = []; var laserPointers = []; var laserDot = null; var mice = []; var dogs = []; var separators = []; var nextMouseSpawn = 0; var nextDogSpawn = 0; var nextSeparatorSpawn = 0; var shelfLevels = [580, 880, 1280, 1680, 2080]; // Y positions for 5 shelf levels aligned with object feet var shelves = []; var nextObjectSpawn = 0; var nextDangerousSpawn = 0; var nextLaserSpawn = 0; var cameraX = 0; // Create score display var scoreTxt = new Text2('0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); scoreTxt.y = 50; // Create lives display var livesText = new Text2('Lives: 3', { size: 60, fill: 0xFF6B6B }); livesText.anchor.set(0, 0); LK.gui.topLeft.addChild(livesText); livesText.x = 120; // Avoid the menu icon area livesText.y = 50; // Create claw button var clawButton = LK.gui.bottomRight.addChild(LK.getAsset('zarpazo', { anchorX: 1, anchorY: 1, scaleX: 2, scaleY: 2 })); clawButton.x = -20; clawButton.y = -20; clawButton.alpha = 0.8; // Create shelves for (var level = 0; level < 5; level++) { for (var section = 0; section < 10; section++) { var shelf = game.addChild(LK.getAsset('shelf', { anchorX: 0, anchorY: 1 })); shelf.x = section * 400; shelf.y = shelfLevels[level]; shelves.push(shelf); } } // Create cat cat = game.addChild(new Cat()); cat.x = 1024; // Exact center of screen horizontally (2048 / 2 = 1024 pixels) cat.targetShelfLevel = 2; // Start on middle shelf cat.currentShelfLevel = cat.targetShelfLevel; cat.y = shelfLevels[cat.targetShelfLevel] - 178; // Position cat to stand on shelf (accounting for cat height and anchor) // Handle swipe controls var swipeStartX = 0; var swipeStartY = 0; var isDragging = false; game.down = function (x, y, obj) { // Check if claw button was pressed var buttonBounds = clawButton.getBounds(); var buttonWorldPos = LK.gui.bottomRight.toGlobal(clawButton.position); var buttonDistance = Math.sqrt((x - buttonWorldPos.x) * (x - buttonWorldPos.x) + (y - buttonWorldPos.y) * (y - buttonWorldPos.y)); if (buttonDistance < 100) { // Claw button pressed - make cat throw nearby objects var throwRange = 150; for (var i = shelfObjects.length - 1; i >= 0; i--) { var obj = shelfObjects[i]; var distance = Math.abs(obj.x - cat.x) + Math.abs(obj.y - cat.y); if (distance < throwRange && !obj.isFalling) { obj.startFalling(); LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); // Play random knock sound var soundId = 'knock' + (Math.floor(Math.random() * 3) + 1); LK.getSound(soundId).play(); } } // Flash claw button to show it was activated LK.effects.flashObject(clawButton, 0xffff00, 300); return; } swipeStartX = x; swipeStartY = y; isDragging = true; // If in laser mode, move laser dot if (cat.isLaserMode && laserDot) { laserDot.x = x; laserDot.y = y; } else { // Check if user clicked near a mouse to start hunting for (var i = 0; i < mice.length; i++) { var mouse = mice[i]; var mouseWorldX = mouse.x + game.x; var mouseWorldY = mouse.y + game.y; var distance = Math.sqrt((x - mouseWorldX) * (x - mouseWorldX) + (y - mouseWorldY) * (y - mouseWorldY)); if (distance < 100) { // Start hunting this mouse cat.isChasing = true; cat.chaseTarget = mouse; mouse.isBeingChased = true; LK.getSound('mouseSqueak').play(); break; } } } }; game.move = function (x, y, obj) { // If in laser mode, move laser dot if (cat.isLaserMode && laserDot) { laserDot.x = x; laserDot.y = y; } }; game.up = function (x, y, obj) { if (!isDragging) { return; } isDragging = false; var deltaX = x - swipeStartX; var deltaY = y - swipeStartY; var swipeDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); if (swipeDistance < 50) { return; } // Minimum swipe distance if (Math.abs(deltaY) > Math.abs(deltaX)) { // Vertical swipe - change shelf level if (deltaY < 0 && cat.targetShelfLevel > 0) { cat.targetShelfLevel--; // Swipe up } else if (deltaY > 0 && cat.targetShelfLevel < 4) { cat.targetShelfLevel++; // Swipe down } } else { // Horizontal swipe - change direction if (!cat.isLaserMode) { if (deltaX > 0) { cat.direction = 1; // Right } else { cat.direction = -1; // Left } } } }; // Spawn objects and laser pointers function spawnObject() { if (LK.ticks < nextObjectSpawn) { return; } var objectType = Math.floor(Math.random() * 3) + 1; var obj = new ShelfObject(objectType); var level = Math.floor(Math.random() * 5); var xPos = cat.x + Math.random() * 800 + 400; obj.x = xPos; obj.y = shelfLevels[level] - 75; // Position on top of shelf game.addChild(obj); shelfObjects.push(obj); nextObjectSpawn = LK.ticks + 5 + Math.random() * 10; // Much faster spawning } function spawnDangerousObject() { if (LK.ticks < nextDangerousSpawn) { return; } var dangerousObj = new DangerousObject(); var level = Math.floor(Math.random() * 5); var xPos = cat.x + Math.random() * 1000 + 600; dangerousObj.x = xPos; dangerousObj.y = shelfLevels[level] - 75; // Position on top of shelf game.addChild(dangerousObj); dangerousObjects.push(dangerousObj); nextDangerousSpawn = LK.ticks + 30 + Math.random() * 45; // 0.5-1.25 seconds - much faster spawning } function spawnLaserPointer() { if (LK.ticks < nextLaserSpawn) { return; } var pointer = new LaserPointer(); var level = Math.floor(Math.random() * 5); var xPos = cat.x + Math.random() * 600 + 300; pointer.x = xPos; pointer.y = shelfLevels[level] - 75; // Position on top of shelf game.addChild(pointer); laserPointers.push(pointer); nextLaserSpawn = LK.ticks + 600 + Math.random() * 600; // 10-20 seconds } function spawnMouse() { if (LK.ticks < nextMouseSpawn) { return; } var mouse = new Mouse(); var level = Math.floor(Math.random() * 5); var xPos = cat.x + (Math.random() < 0.5 ? -1 : 1) * (Math.random() * 400 + 200); mouse.x = xPos; mouse.y = shelfLevels[level] - 75; // Position on top of shelf game.addChild(mouse); mice.push(mouse); nextMouseSpawn = LK.ticks + 450 + Math.random() * 300; // 7.5-12.5 seconds - faster spawning } function spawnDog() { if (LK.ticks < nextDogSpawn) { return; } var dog = new Dog(); var level = Math.floor(Math.random() * 5); var xPos = cat.x + (Math.random() < 0.5 ? -1 : 1) * (Math.random() * 500 + 300); dog.x = xPos; dog.y = shelfLevels[level] - 75; // Position on top of shelf game.addChild(dog); dogs.push(dog); nextDogSpawn = LK.ticks + 1200 + Math.random() * 900; // 20-35 seconds } function spawnSeparator() { if (LK.ticks < nextSeparatorSpawn) { return; } var separator = new Separator(); var level = Math.floor(Math.random() * 5); var xPos = cat.x + Math.random() * 1200 + 800; separator.x = xPos; separator.y = shelfLevels[level] - 150; // Position higher above shelf game.addChild(separator); separators.push(separator); nextSeparatorSpawn = LK.ticks + 60 + Math.random() * 90; // 1-2.5 seconds - much faster obstacles } // Camera follow with smooth tweening function updateCamera() { var targetCameraX = cat.x - 512; // Closer camera view // Smooth camera movement with easing if (Math.abs(cameraX - targetCameraX) > 5) { tween.stop(game, { x: true }); // Stop any existing camera tween tween(game, { x: -targetCameraX }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { cameraX = targetCameraX; } }); } else { cameraX = targetCameraX; game.x = -cameraX; } // Generate new shelves as needed var rightmostShelf = Math.max.apply(Math, shelves.map(function (s) { return s.x; })); if (rightmostShelf < cameraX + 3000) { for (var level = 0; level < 5; level++) { for (var section = 0; section < 5; section++) { var shelf = game.addChild(LK.getAsset('shelf', { anchorX: 0, anchorY: 1 })); shelf.x = rightmostShelf + 400 + section * 400; shelf.y = shelfLevels[level]; shelves.push(shelf); } } } } game.update = function () { spawnObject(); spawnDangerousObject(); spawnLaserPointer(); spawnMouse(); spawnDog(); spawnSeparator(); updateCamera(); // Clean up off-screen objects for (var i = shelfObjects.length - 1; i >= 0; i--) { var obj = shelfObjects[i]; if (obj.x < cameraX - 500) { obj.destroy(); shelfObjects.splice(i, 1); } } for (var i = dangerousObjects.length - 1; i >= 0; i--) { var dangerousObj = dangerousObjects[i]; if (dangerousObj.x < cameraX - 500) { dangerousObj.destroy(); dangerousObjects.splice(i, 1); } } for (var i = laserPointers.length - 1; i >= 0; i--) { var pointer = laserPointers[i]; if (pointer.x < cameraX - 500) { pointer.destroy(); laserPointers.splice(i, 1); } } // Clean up separators for (var i = separators.length - 1; i >= 0; i--) { var separator = separators[i]; if (separator.x < cameraX - 500) { separator.destroy(); separators.splice(i, 1); } } // Clean up mice for (var i = mice.length - 1; i >= 0; i--) { var mouse = mice[i]; if (mouse.x < cameraX - 600 || mouse.x > cameraX + 2500) { if (mouse === cat.chaseTarget) { cat.isChasing = false; cat.chaseTarget = null; } mouse.destroy(); mice.splice(i, 1); } } // Clean up dogs for (var i = dogs.length - 1; i >= 0; i--) { var dog = dogs[i]; if (dog.x < cameraX - 600 || dog.x > cameraX + 2500) { if (dog === cat.hideTarget) { cat.isHiding = false; cat.hideTarget = null; } dog.destroy(); dogs.splice(i, 1); } } // Remove laser dot when laser mode ends if (!cat.isLaserMode && laserDot) { laserDot.destroy(); laserDot = null; } };
===================================================================
--- original.js
+++ change.js
@@ -462,12 +462,18 @@
var distance = Math.abs(self.x - cat.x) + Math.abs(self.y - cat.y);
if (distance < self.alertRadius) {
cat.isHiding = true;
cat.hideTarget = self;
- if (Math.random() < 0.02) {
+ if (Math.random() < 0.08) {
+ // Increased from 0.02 to 0.08 for more frequent barking
LK.getSound('dogBark').play();
}
}
+ // Additional barking when mouth opens (barking animation)
+ if (self.barkTimer === 0 && !self.isBarkingOpen && Math.random() < 0.7) {
+ // 70% chance to bark when switching to open mouth
+ LK.getSound('dogBark').play();
+ }
};
return self;
});
var LaserPointer = Container.expand(function () {
Tabla de madera vista de costado, muy fina. Pixel art. In-Game asset. 2d. High contrast. No shadows
Raton tipo pixel art earthworm jim, la personalidad del ratón debe ser frenética asustadizo como la de ten de ten y stimpy, debe estar en cuatro patas. In-Game asset. 2d. High contrast. No shadows
Un perro bobo ladrando con los ojos cerrados pixel art dientes grandes, estilo earthworm jim. In-Game asset. 2d. High contrast. No shadows
Una madera separadora de estantería pixel art estilo metal slug vista de perfil In-Game asset. 2d. High contrast. No shadows
plato con decoraciones de oro pixel art metal slug style. In-Game asset. 2d. High contrast. No shadows
un vaso con agua estilo pixel art metal slug. In-Game asset. 2d. High contrast. No shadows
Un jabon con espuma, pixel art, metal slug. In-Game asset. 2d. High contrast. No shadows
hazlo con fondo verde, con el mismo estilo dando un sarpazo con mirada burlona a la camara
hazlo con fondo verde, con el mismo estilo cerrando los dientes con fuerza y bronca
Con el mismo estilo, modo cauteloso con la boca cerrada
Un foco pixel art tipo metal slug. In-Game asset. 2d. High contrast. No shadows
Un velador con base muy simple, sin lampara, tipo pixel art meta slug. In-Game asset. 2d. High contrast. No shadows
El mudo gato con el mismo estilo pero electrocutado con fondo verde
puedes cambiar la posicion de las patas, es decir las que estan atras pasan adelante y viceversa, con el mismo estilo pixel art de la foto original y fondo azul
cambia la posicion de las piernas como si hubiese dado un paso con el mismo estilo pixel art
Maceta con una flor, pixel art metal slug. In-Game asset. 2d. High contrast. No shadows
Puedes encerrarlo en una burbuja
En medio de un salto con el mismo estilo pixel art y fondo verde
con cara arrogante tiene que tirar un beso a camara y mostrar un corazon, la imagen sarcastica y graciosa, con fondo verde
El gato de estar sentado sobre sus dos patas traseras señalando hacia adelante y mirando a la cámara como irónicamente porque no puedes seguir avanzando
una pecera con un pez durmiendo, con estilo pixel art de metal slug con fondo verde. In-Game asset. 2d. High contrast. No shadows
el gato asustado arqueado con los pelos parados con el mismo estilo pixel art
un iphone en pixel art que tenga en la pantalla un ninja con una estrella y un rollo de papel higienico estilo comico. In-Game asset. 2d. High contrast. No shadows
el pez asustadisimo con estilo comico sin sombra con fondo verde
imagina un portatil que tenga en la pantalla la imagen actual, debe ser pixel art y con estilo comico
quiero construir una columa cilindrica muy larga de madera, para eso tengo que recurrir a repetir assets uno arriba del otro , puedes crear un segmento que pueda repetirse en pixel art?. In-Game asset. 2d. High contrast. No shadows
necesito construir un background para un hud, color madera clarito con 2 tornillos en los extremos bien en los bordes, con un borde viselado pixel art, muchisimo mas ancho que alto (relacion 5 - 20 aprox). In-Game asset. 2d. High contrast. No shadows
imagina un fondo con el mismo estilo del juego, debe decir arriba, Catatack y tener un estilo gatuno, siempre en pixel art, en el medio de la imagen, pondre texto variable, debes dejar ese espacio libre.. In-Game asset. 2d. High contrast. No shadows
reimaginalo bailando como tony manero en fiebre de sabado por la noche con fondo verde
una bola de espejos tipo fiebre de sabado por la noche con estilo pixel art con el cable de donde cuelga largo, con fondo verde . In-Game asset. 2d. High contrast. No shadows
perro cayendo de mucha altura asustadisimo con el mismo estilo con fondo verde, muy gracioso
dibuja 3 zetas en vez de 2, manten el mismo estilo pixel art