User prompt
necesito cambiar la posicion inicial del gato al medio de la pantalla
User prompt
el gato debe estar al frente de las tablas
User prompt
La lámpara debe estar delante del light bulb
User prompt
La posición inicial del gato debe ser al centro de la pantalla ni más atrás no más adelante
User prompt
La posición inicial del gato debe ser el centro del candado, ahora está retrasado
User prompt
La posición inicial del gato debe ser el centro de la pantalla según x
User prompt
El gato tu tiene que estar al centro
User prompt
El gato tiene que estar al centro, ni adelante, ni atras
User prompt
El gato no se mueve ahora
User prompt
El bulb debe estar mas arriba y brillarz no escalar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
La posision del gato es en el centro de la pantalla horizontalmente
User prompt
El soap el objeto jabon que ya existe, no hace falta el asset nuevo
User prompt
Cuando toca el jabon debe empezar a resbalarse ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Agrega un velador con un foco visible, al tirarlo el gato debe electrocutarse por 3 segundos, el foco debe ser pixel art tipo metal slug ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Deja de responder después de determinado tiempo
User prompt
El gato en cierto momento pierde el control del usuario, no debe pasar
User prompt
El gato cambia de dirección solo, lo debe mover el usuario
User prompt
Muchos menos objetos, 10% de lo actual
User prompt
El gato no debe perseguir al ratón
User prompt
El cambio de dirección del gato debe ser inmediata
User prompt
El zarpazo debe ser mucho más rápido ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Cada objeto que caer debe hacer un ruido dependiendo el tipo de objeto
User prompt
No hay botón zarpazo, es automático
User prompt
Please fix the bug: 'TypeError: setTimeout is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 79
User prompt
El gato debe cambiar a zarpazo por un segundo cuando toma un objeto ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/****
* 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.isZarpazoMode = false;
self.zarpazoGraphics = null;
self.activateZarpazo = function () {
if (self.isZarpazoMode) return; // Already in zarpazo mode
self.isZarpazoMode = true;
// Create zarpazo graphics if not exists
if (!self.zarpazoGraphics) {
self.zarpazoGraphics = self.attachAsset('zarpazo', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2,
scaleY: 2
});
}
// Show zarpazo, hide normal cat
catGraphics.visible = false;
self.zarpazoGraphics.visible = true;
self.zarpazoGraphics.scaleX = 2 * self.direction;
self.zarpazoGraphics.scaleY = 2;
// Return to normal after much faster zarpazo
tween.stop(self, {
isZarpazoMode: true
}); // Stop any existing zarpazo tween
LK.setTimeout(function () {
self.isZarpazoMode = false;
catGraphics.visible = true;
if (self.zarpazoGraphics) {
self.zarpazoGraphics.visible = false;
}
}, 200); // 0.2 seconds for much faster zarpazo
};
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 {
// Move cat directly without tweening for immediate direction changes
self.x += self.speed * self.direction;
// Update graphics direction immediately
if (self.direction > 0) {
catGraphics.scaleX = 1;
if (self.zarpazoGraphics) {
self.zarpazoGraphics.scaleX = 2;
}
} else {
catGraphics.scaleX = -1;
if (self.zarpazoGraphics) {
self.zarpazoGraphics.scaleX = -2;
}
}
}
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();
// Activate zarpazo mode when knocking objects
self.activateZarpazo();
}
}
// 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 electrocution
if (self.isElectrocuted === undefined) {
self.isElectrocuted = false;
self.electrocutionTimer = 0;
}
if (self.isElectrocuted) {
self.electrocutionTimer--;
// Cat cannot move when electrocuted
self.speed = 0;
// Electric flash effect - rapid blue/white flashing
var electricFlash = Math.sin(LK.ticks * 2) > 0;
catGraphics.tint = electricFlash ? 0x00FFFF : 0xFFFFFF;
catGraphics.alpha = 0.7 + Math.sin(LK.ticks * 1.5) * 0.3;
if (self.electrocutionTimer <= 0) {
self.isElectrocuted = false;
self.speed = self.isLaserMode ? self.laserSpeed : self.normalSpeed;
catGraphics.tint = 0xFFFFFF;
catGraphics.alpha = 1;
}
}
// Handle soap slipping
if (self.isSlipping === undefined) {
self.isSlipping = false;
self.slipTimer = 0;
self.originalDirection = self.direction;
}
if (self.isSlipping) {
self.slipTimer--;
// Cat slides uncontrollably in random directions
if (self.slipTimer % 30 === 0) {
// Change direction every 0.5 seconds
self.direction = Math.random() < 0.5 ? 1 : -1;
}
// Slipping animation - cat tilts side to side
var tilt = Math.sin(LK.ticks * 0.4) * 0.3;
catGraphics.rotation = tilt;
catGraphics.alpha = 0.8; // Slightly transparent while slipping
if (self.slipTimer <= 0) {
self.isSlipping = false;
self.direction = self.originalDirection;
catGraphics.rotation = 0;
catGraphics.alpha = 1;
}
}
// Handle invulnerability timer
if (self.isInvulnerable) {
self.invulnerabilityTimer--;
// Flash effect during invulnerability (only if not electrocuted)
if (!self.isElectrocuted) {
catGraphics.alpha = Math.sin(LK.ticks * 0.5) * 0.5 + 0.5;
}
if (self.invulnerabilityTimer <= 0) {
self.isInvulnerable = false;
if (!self.isElectrocuted) {
catGraphics.alpha = 1;
}
}
}
// Check for collisions with lamps
for (var i = lamps.length - 1; i >= 0; i--) {
var lamp = lamps[i];
if (self.intersects(lamp) && !lamp.isFalling && !self.isElectrocuted) {
lamp.startFalling();
LK.setScore(LK.getScore() + 15);
scoreTxt.setText(LK.getScore());
// Activate zarpazo mode when knocking lamp
self.activateZarpazo();
}
}
// Check for soap collision
for (var i = soaps.length - 1; i >= 0; i--) {
var soap = soaps[i];
if (self.intersects(soap) && !soap.hasBeenUsed && !self.isSlipping) {
soap.hasBeenUsed = true;
// Cat starts slipping for 3 seconds
self.isSlipping = true;
self.slipTimer = 180; // 3 seconds at 60fps
self.originalDirection = self.direction;
// Play slip sound
LK.getSound('soapSlip').play();
// Visual effect - soap disappears with tween
tween(soap, {
alpha: 0,
scaleX: 0.1,
scaleY: 0.1
}, {
duration: 500,
easing: tween.easeOut,
onFinish: function onFinish() {
soap.destroy();
var index = soaps.indexOf(soap);
if (index > -1) {
soaps.splice(index, 1);
}
}
});
// Flash screen light blue for soap effect
LK.effects.flashScreen(0x87CEEB, 800);
break;
}
}
// 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;
// Activate zarpazo mode when picking up laser pointer
self.activateZarpazo();
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
// Play dangerous object falling sound
LK.getSound('dangerousFall').play();
};
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 for barking only
var distance = Math.abs(self.x - cat.x) + Math.abs(self.y - cat.y);
if (distance < self.alertRadius) {
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 Lamp = Container.expand(function () {
var self = Container.call(this);
// Create lamp base
var lampGraphics = self.attachAsset('lamp', {
anchorX: 0.5,
anchorY: 1,
scaleX: 3,
scaleY: 3
});
// Create visible light bulb on top
var lightBulbGraphics = self.attachAsset('lightbulb', {
anchorX: 0.5,
anchorY: 1,
scaleX: 2.5,
scaleY: 2.5
});
lightBulbGraphics.y = -90; // Position above lamp base
self.isFalling = false;
self.fallSpeed = 0;
self.pulseTimer = 0;
self.hasElectrocuted = false;
self.startFalling = function () {
if (self.isFalling) return;
self.isFalling = true;
self.fallSpeed = 2;
// Play lamp falling sound
LK.getSound('objectHit').play();
// Add falling animation with rotation
tween(self, {
rotation: self.rotation + Math.PI * 2
}, {
duration: 1500,
easing: tween.easeOut
});
};
self.update = function () {
if (!self.isFalling) {
// Gentle glow pulse effect for the light bulb
self.pulseTimer++;
var glowScale = 1 + Math.sin(self.pulseTimer * 0.1) * 0.2;
lightBulbGraphics.scaleX = 2.5 * glowScale;
lightBulbGraphics.scaleY = 2.5 * glowScale;
// Subtle yellow tint for glow effect
var glowIntensity = 0.8 + Math.sin(self.pulseTimer * 0.1) * 0.2;
lightBulbGraphics.alpha = glowIntensity;
} else {
self.y += self.fallSpeed;
self.fallSpeed += 0.3; // Gravity
// Check for collision with cat when falling
if (!self.hasElectrocuted && self.intersects(cat)) {
self.hasElectrocuted = true;
// Electrocute cat for 3 seconds
cat.isElectrocuted = true;
cat.electrocutionTimer = 180; // 3 seconds at 60fps
// Play electric shock sound
LK.getSound('electricShock').play();
// Flash screen blue/white for electric effect
LK.effects.flashScreen(0x00FFFF, 1000);
// Make cat flash and shake
tween(cat, {
x: cat.x + 10
}, {
duration: 100,
easing: tween.linear,
onFinish: function onFinish() {
tween(cat, {
x: cat.x - 20
}, {
duration: 100,
easing: tween.linear,
onFinish: function onFinish() {
tween(cat, {
x: cat.x + 10
}, {
duration: 100,
easing: tween.linear
});
}
});
}
});
}
// Remove when off screen
if (self.y > 2732 + 100) {
self.destroy();
var index = lamps.indexOf(self);
if (index > -1) {
lamps.splice(index, 1);
}
}
}
};
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
var distance = Math.abs(self.x - cat.x) + Math.abs(self.y - cat.y);
if (distance < 100 && !self.isBeingChased) {
self.isBeingChased = true;
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;
// Play sound based on object type
var soundId = 'objectFall' + (objectType || 1);
LK.getSound(soundId).play();
// 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('objectHit').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;
});
var Soap = Container.expand(function () {
var self = Container.call(this);
var soapGraphics = self.attachAsset('soap', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
scaleY: 3
});
self.pulseTimer = 0;
self.hasBeenUsed = false;
self.update = function () {
// Gentle shine effect to make soap visible
self.pulseTimer++;
var shine = 1 + Math.sin(self.pulseTimer * 0.15) * 0.2;
soapGraphics.alpha = shine;
soapGraphics.tint = 0xF0F8FF; // Light blue tint for soap
};
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 lamps = [];
var soaps = [];
var nextMouseSpawn = 0;
var nextDogSpawn = 0;
var nextSeparatorSpawn = 0;
var nextLampSpawn = 0;
var nextSoapSpawn = 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;
var gameTimer = 0;
var TIME_LIMIT = 3600; // 60 seconds at 60fps (3600 ticks)
// 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 timer display
var timerText = new Text2('Time: 60', {
size: 60,
fill: 0xFFD700
});
timerText.anchor.set(1, 0);
LK.gui.topRight.addChild(timerText);
timerText.x = -20;
timerText.y = 50;
// Claw button removed - zarpazo is now automatic when picking up objects
// 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) {
swipeStartX = x;
swipeStartY = y;
isDragging = true;
// If in laser mode, move laser dot
if (cat.isLaserMode && laserDot) {
laserDot.x = x;
laserDot.y = y;
}
};
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 + 50 + Math.random() * 100; // 10% spawn rate - much slower 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 + 300 + Math.random() * 450; // 10% spawn rate - 5-12.5 seconds
}
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 + 4500 + Math.random() * 3000; // 10% spawn rate - 75-125 seconds
}
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 + 12000 + Math.random() * 9000; // 10% spawn rate - 200-350 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 + 600 + Math.random() * 900; // 10% spawn rate - 10-25 seconds
}
function spawnLamp() {
if (LK.ticks < nextLampSpawn) {
return;
}
var lamp = new Lamp();
var level = Math.floor(Math.random() * 5);
var xPos = cat.x + Math.random() * 800 + 400;
lamp.x = xPos;
lamp.y = shelfLevels[level]; // Position on shelf
game.addChild(lamp);
lamps.push(lamp);
nextLampSpawn = LK.ticks + 900 + Math.random() * 1200; // 15-35 seconds
}
function spawnSoap() {
if (LK.ticks < nextSoapSpawn) {
return;
}
var soap = new Soap();
var level = Math.floor(Math.random() * 5);
var xPos = cat.x + Math.random() * 600 + 300;
soap.x = xPos;
soap.y = shelfLevels[level] - 40; // Position on shelf
game.addChild(soap);
soaps.push(soap);
nextSoapSpawn = LK.ticks + 1200 + Math.random() * 1800; // 20-50 seconds
}
// 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 () {
// Update game timer
gameTimer++;
var remainingTime = Math.max(0, Math.ceil((TIME_LIMIT - gameTimer) / 60));
timerText.setText('Time: ' + remainingTime);
// Check if time limit reached
if (gameTimer >= TIME_LIMIT) {
LK.showYouWin();
return;
}
spawnObject();
spawnDangerousObject();
spawnLaserPointer();
spawnMouse();
spawnDog();
spawnSeparator();
spawnLamp();
spawnSoap();
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 lamps
for (var i = lamps.length - 1; i >= 0; i--) {
var lamp = lamps[i];
if (lamp.x < cameraX - 500) {
lamp.destroy();
lamps.splice(i, 1);
}
}
// Clean up soaps
for (var i = soaps.length - 1; i >= 0; i--) {
var soap = soaps[i];
if (soap.x < cameraX - 500) {
soap.destroy();
soaps.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
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