User prompt
y=5
User prompt
y=10
User prompt
move it to y=20
User prompt
move the mouth up
User prompt
move the mouth up
User prompt
move the mouth up
User prompt
move pet moth from y=30 to y=70
User prompt
move mouth up a bit
Code edit (1 edits merged)
Please save this source code
User prompt
Digital Pet Nightmare
User prompt
go back to digital pet nightmare
User prompt
Please continue polishing my design document.
Initial prompt
Create a game that resembles the ARG horror game KinitoPet
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Button = Container.expand(function (type) { var self = Container.call(this); self.type = type; var buttonShape = self.attachAsset(type + 'Button', { anchorX: 0.5, anchorY: 0.5 }); var icon = self.attachAsset('buttonIcon', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.8, scaleY: 0.8 }); var label = new Text2(type.charAt(0).toUpperCase() + type.slice(1), { size: 40, fill: 0xFFFFFF }); label.anchor.set(0.5, 0.5); label.y = 70; self.addChild(label); self.interactive = true; self.down = function (x, y, obj) { tween(buttonShape, { scaleX: 0.9, scaleY: 0.9 }, { duration: 100, easing: tween.easeOut }); }; self.up = function (x, y, obj) { tween(buttonShape, { scaleX: 1.0, scaleY: 1.0 }, { duration: 100, easing: tween.easeOut }); LK.getSound(self.type).play(); switch (self.type) { case 'feed': pet.feed(); break; case 'play': pet.play(); break; case 'clean': pet.clean(); break; } }; return self; }); var CorruptionParticle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.attachAsset('corruptionEffect', { anchorX: 0.5, anchorY: 0.5, alpha: 0.6 }); self.lifespan = 0; self.maxLife = 0; self.speedX = 0; self.speedY = 0; self.active = false; self.initialize = function (x, y, duration) { self.x = x; self.y = y; self.maxLife = duration; self.lifespan = duration; self.speedX = (Math.random() - 0.5) * 3; self.speedY = (Math.random() - 0.5) * 3; self.rotation = Math.random() * Math.PI * 2; self.active = true; self.visible = true; self.alpha = 0.6; var randomColor = Math.random(); if (randomColor < 0.33) { particleGraphics.tint = 0x550055; // Purple } else if (randomColor < 0.66) { particleGraphics.tint = 0x990000; // Dark red } else { particleGraphics.tint = 0x006600; // Dark green } }; self.update = function () { if (!self.active) { return; } self.lifespan--; self.x += self.speedX; self.y += self.speedY; self.alpha = self.lifespan / self.maxLife * 0.6; if (self.lifespan <= 0) { self.active = false; self.visible = false; } }; self.visible = false; self.active = false; return self; }); var GlitchEffect = Container.expand(function () { var self = Container.call(this); var glitchGraphics = self.attachAsset('glitchEffect', { anchorX: 0.5, anchorY: 0.5, alpha: 0.7 }); self.startGlitch = function () { self.visible = true; self.x = Math.random() * 2048; self.y = Math.random() * 2732; self.rotation = Math.random() * Math.PI * 2; self.alpha = 0.7; tween(self, { alpha: 0 }, { duration: 300 + Math.random() * 700, onFinish: function onFinish() { self.visible = false; } }); }; self.visible = false; return self; }); var Pet = Container.expand(function () { var self = Container.call(this); // Stats self.hunger = 100; self.happiness = 100; self.cleanliness = 100; self.corruption = 0; self.stage = 0; // 0 = normal, 1 = starting to corrupt, 2 = more corrupt, 3 = nightmare // Visual components var body = self.attachAsset('petBody', { anchorX: 0.5, anchorY: 0.5, scaleX: 1, scaleY: 1 }); var leftEye = self.attachAsset('petEye', { anchorX: 0.5, anchorY: 0.5, x: -70, y: -50 }); var rightEye = self.attachAsset('petEye', { anchorX: 0.5, anchorY: 0.5, x: 70, y: -50 }); var mouth = self.attachAsset('petMouth', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 5 }); // Food item that appears when feeding var foodItem = self.attachAsset('food', { anchorX: 0.5, anchorY: 0.5, visible: false, x: 0, y: -200 }); // Toy that appears when playing var toyItem = self.attachAsset('toy', { anchorX: 0.5, anchorY: 0.5, visible: false, x: 200, y: 0 }); // Dirt patches that appear when pet is dirty var dirtPatches = []; for (var i = 0; i < 5; i++) { var dirt = self.attachAsset('dirt', { anchorX: 0.5, anchorY: 0.5, visible: false, x: (Math.random() - 0.5) * 200, y: (Math.random() - 0.5) * 200 }); dirtPatches.push(dirt); } self.blink = function () { tween(leftEye, { scaleY: 0.1 }, { duration: 100, onFinish: function onFinish() { tween(leftEye, { scaleY: 1 }, { duration: 100 }); } }); tween(rightEye, { scaleY: 0.1 }, { duration: 100, onFinish: function onFinish() { tween(rightEye, { scaleY: 1 }, { duration: 100 }); } }); }; self.breathe = function () { tween(body, { scaleY: 1.05 }, { duration: 1000, onFinish: function onFinish() { tween(body, { scaleY: 1 }, { duration: 1000 }); } }); }; self.feed = function () { if (self.hunger >= 95) { return; } foodItem.visible = true; foodItem.y = -200; tween(foodItem, { y: 0 }, { duration: 500, onFinish: function onFinish() { self.hunger = Math.min(100, self.hunger + 30); updateStatusBars(); tween(foodItem, { alpha: 0 }, { duration: 300, onFinish: function onFinish() { foodItem.visible = false; foodItem.alpha = 1; } }); // Make pet happy from feeding tween(mouth, { scaleX: 1.3, scaleY: 1.3 }, { duration: 300, onFinish: function onFinish() { tween(mouth, { scaleX: 1, scaleY: 1 }, { duration: 300 }); } }); } }); // Sometimes add corruption from feeding in later stages if (self.corruption > 40 && Math.random() < 0.3) { self.addCorruption(5); triggerGlitch(); } }; self.play = function () { if (self.happiness >= 95) { return; } toyItem.visible = true; toyItem.x = 200; tween(toyItem, { x: 0 }, { duration: 500, onFinish: function onFinish() { self.happiness = Math.min(100, self.happiness + 30); updateStatusBars(); // Bounce toy tween(toyItem, { y: -100 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { tween(toyItem, { y: 0, alpha: 0 }, { duration: 300, easing: tween.easeIn, onFinish: function onFinish() { toyItem.visible = false; toyItem.alpha = 1; } }); } }); // Make pet happy from playing tween(body, { rotation: 0.1 }, { duration: 200, onFinish: function onFinish() { tween(body, { rotation: -0.1 }, { duration: 200, onFinish: function onFinish() { tween(body, { rotation: 0 }, { duration: 200 }); } }); } }); } }); // Sometimes add corruption from playing in later stages if (self.corruption > 40 && Math.random() < 0.3) { self.addCorruption(5); triggerGlitch(); } }; self.clean = function () { if (self.cleanliness >= 95) { return; } self.cleanliness = Math.min(100, self.cleanliness + 30); updateStatusBars(); // Hide dirt patches for (var i = 0; i < dirtPatches.length; i++) { dirtPatches[i].visible = false; } // Sparkle effect tween(body, { alpha: 0.7 }, { duration: 200, onFinish: function onFinish() { tween(body, { alpha: 1 }, { duration: 200 }); } }); // Sometimes add corruption from cleaning in later stages if (self.corruption > 40 && Math.random() < 0.3) { self.addCorruption(5); triggerGlitch(); } }; self.updateStats = function () { // Decrease stats over time self.hunger = Math.max(0, self.hunger - 0.1); self.happiness = Math.max(0, self.happiness - 0.15); self.cleanliness = Math.max(0, self.cleanliness - 0.12); // Show dirt when dirty for (var i = 0; i < dirtPatches.length; i++) { dirtPatches[i].visible = self.cleanliness < 50 + i * 10; } // Corruption increases when needs are low if (self.hunger < 30 || self.happiness < 30 || self.cleanliness < 30) { self.addCorruption(0.05); if (Math.random() < 0.1) { triggerGlitch(); } } // Update visual based on corruption level self.updateAppearance(); }; self.addCorruption = function (amount) { var oldCorruption = self.corruption; self.corruption = Math.min(100, self.corruption + amount); if (oldCorruption < 33 && self.corruption >= 33) { self.evolve(1); } else if (oldCorruption < 66 && self.corruption >= 66) { self.evolve(2); } else if (oldCorruption < 100 && self.corruption >= 100) { self.evolve(3); } updateStatusBars(); }; self.evolve = function (stage) { self.stage = stage; LK.getSound('transform').play(); // Create a strong glitch effect for evolution for (var i = 0; i < 10; i++) { LK.setTimeout(function () { triggerGlitch(); }, i * 200); } // Show strong visual change tween(body, { scaleX: 1.3, scaleY: 1.3, alpha: 0.5 }, { duration: 500, onFinish: function onFinish() { self.updateAppearance(); tween(body, { scaleX: 1, scaleY: 1, alpha: 1 }, { duration: 500 }); } }); }; self.updateAppearance = function () { // Base form - cute and blue if (self.stage === 0) { body.tint = 0xaae1fc; leftEye.tint = 0x000000; rightEye.tint = 0x000000; mouth.tint = 0x9966cc; leftEye.x = -70; rightEye.x = 70; leftEye.y = rightEye.y = -50; mouth.y = 30; // Reset any distortions leftEye.scaleX = leftEye.scaleY = 1; rightEye.scaleX = rightEye.scaleY = 1; mouth.scaleX = mouth.scaleY = 1; mouth.rotation = 0; } // Stage 1 - starting to corrupt else if (self.stage === 1) { body.tint = 0x99ccdd; leftEye.tint = 0x220000; rightEye.tint = 0x220000; mouth.tint = 0x774499; // Slight asymmetry leftEye.x = -75; rightEye.x = 68; leftEye.scaleX = 1.1; rightEye.scaleX = 0.9; mouth.rotation = 0.1; } // Stage 2 - more corrupt else if (self.stage === 2) { body.tint = 0x7799aa; leftEye.tint = 0x440000; rightEye.tint = 0x440000; mouth.tint = 0x553366; // More distortion leftEye.x = -80; rightEye.x = 65; leftEye.y = -55; rightEye.y = -45; leftEye.scaleX = 1.3; leftEye.scaleY = 0.8; rightEye.scaleX = 0.8; rightEye.scaleY = 1.2; mouth.y = 60; mouth.scaleX = 1.2; mouth.rotation = 0.2; } // Stage 3 - nightmare else if (self.stage === 3) { body.tint = 0x445566; leftEye.tint = 0x880000; rightEye.tint = 0x880000; mouth.tint = 0x331133; // Severe distortion leftEye.x = -90; rightEye.x = 60; leftEye.y = -65; rightEye.y = -35; leftEye.scaleX = 1.6; leftEye.scaleY = 0.6; rightEye.scaleX = 0.6; rightEye.scaleY = 1.6; mouth.y = 70; mouth.scaleX = 1.5; mouth.scaleY = 0.7; mouth.rotation = 0.3; } }; // Idle animations LK.setInterval(function () { self.blink(); }, 3000 + Math.random() * 2000); LK.setInterval(function () { self.breathe(); }, 2000); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x222233 }); /**** * Game Code ****/ // Game variables var pet; var feedButton, playButton, cleanButton; var statusBars = {}; var corruptionMeter; var gameTime = 0; var glitchEffects = []; var corruptionParticles = []; var gameStarted = false; // Initialize game elements function initGame() { // Setup background game.setBackgroundColor(0x222233); // Create pet pet = new Pet(); pet.x = 2048 / 2; pet.y = 2732 / 2 - 200; game.addChild(pet); // Create UI controls feedButton = new Button('feed'); feedButton.x = 2048 / 4; feedButton.y = 2732 - 200; game.addChild(feedButton); playButton = new Button('play'); playButton.x = 2048 / 2; playButton.y = 2732 - 200; game.addChild(playButton); cleanButton = new Button('clean'); cleanButton.x = 2048 * 3 / 4; cleanButton.y = 2732 - 200; game.addChild(cleanButton); // Create status bars createStatusBars(); // Create glitch effects for (var i = 0; i < 10; i++) { var glitch = new GlitchEffect(); game.addChild(glitch); glitchEffects.push(glitch); } // Create corruption particles for (var i = 0; i < 50; i++) { var particle = new CorruptionParticle(); game.addChild(particle); corruptionParticles.push(particle); } // Create and add title var titleText = new Text2("Digital Pet Nightmare", { size: 100, fill: 0xFFFFFF }); titleText.anchor.set(0.5, 0); titleText.x = 2048 / 2; titleText.y = 100; LK.gui.addChild(titleText); // Create game instructions var instructionsText = new Text2("Feed, play with, and clean your pet to keep it happy. But beware as it slowly corrupts...", { size: 40, fill: 0xDDDDDD }); instructionsText.anchor.set(0.5, 0); instructionsText.x = 2048 / 2; instructionsText.y = 220; instructionsText.width = 1800; LK.gui.addChild(instructionsText); // Start game music LK.playMusic('petMusic', { fade: { start: 0, end: 0.5, duration: 1000 } }); gameStarted = true; } function createStatusBars() { // Create container for all status bars var statusContainer = new Container(); statusContainer.x = 2048 / 2; statusContainer.y = 400; game.addChild(statusContainer); // Create each status bar var statusTypes = [{ name: 'hunger', label: 'Hunger', color: 0x22cc88 }, { name: 'happiness', label: 'Happiness', color: 0xff8822 }, { name: 'cleanliness', label: 'Cleanliness', color: 0x2288ff }]; var yOffset = 0; for (var i = 0; i < statusTypes.length; i++) { var type = statusTypes[i]; // Create label var label = new Text2(type.label, { size: 40, fill: 0xFFFFFF }); label.anchor.set(1, 0.5); label.x = -20; label.y = yOffset; statusContainer.addChild(label); // Create background bar var barBg = LK.getAsset('feedButton', { anchorX: 0, anchorY: 0.5, x: 0, y: yOffset, scaleX: 4, scaleY: 0.5, tint: 0x444444 }); statusContainer.addChild(barBg); // Create value bar var bar = LK.getAsset('feedButton', { anchorX: 0, anchorY: 0.5, x: 0, y: yOffset, scaleX: 4, scaleY: 0.5, tint: type.color }); statusContainer.addChild(bar); // Store reference to bar statusBars[type.name] = bar; yOffset += 60; } // Create corruption meter var corruptionLabel = new Text2("Corruption", { size: 40, fill: 0xFF0088 }); corruptionLabel.anchor.set(1, 0.5); corruptionLabel.x = -20; corruptionLabel.y = yOffset; statusContainer.addChild(corruptionLabel); var corruptionBg = LK.getAsset('feedButton', { anchorX: 0, anchorY: 0.5, x: 0, y: yOffset, scaleX: 4, scaleY: 0.5, tint: 0x444444 }); statusContainer.addChild(corruptionBg); corruptionMeter = LK.getAsset('feedButton', { anchorX: 0, anchorY: 0.5, x: 0, y: yOffset, scaleX: 0, scaleY: 0.5, tint: 0xff0088 }); statusContainer.addChild(corruptionMeter); } function updateStatusBars() { if (!gameStarted) { return; } // Update status bars based on pet stats statusBars.hunger.scaleX = pet.hunger / 25; statusBars.happiness.scaleX = pet.happiness / 25; statusBars.cleanliness.scaleX = pet.cleanliness / 25; // Update corruption meter corruptionMeter.scaleX = pet.corruption / 25; } function triggerGlitch() { // Play glitch sound LK.getSound('glitch').play(); // Visual glitch effects for (var i = 0; i < 3; i++) { var glitch = glitchEffects[Math.floor(Math.random() * glitchEffects.length)]; glitch.startGlitch(); } // Temporarily distort pet if (Math.random() < 0.3) { var originalRotation = pet.rotation; tween(pet, { rotation: originalRotation + (Math.random() - 0.5) * 0.3 }, { duration: 150, onFinish: function onFinish() { tween(pet, { rotation: originalRotation }, { duration: 150 }); } }); } // Screen shake if (Math.random() < 0.2) { var originalX = game.x; var originalY = game.y; tween(game, { x: originalX + (Math.random() - 0.5) * 20 }, { duration: 100, onFinish: function onFinish() { tween(game, { x: originalX }, { duration: 100 }); } }); } } function spawnCorruptionParticle() { // Find an inactive particle for (var i = 0; i < corruptionParticles.length; i++) { var particle = corruptionParticles[i]; if (!particle.active) { // Calculate position relative to pet var offsetX = (Math.random() - 0.5) * 300; var offsetY = (Math.random() - 0.5) * 300; particle.initialize(pet.x + offsetX, pet.y + offsetY, 60 + Math.floor(Math.random() * 60)); break; } } } // Game Update Logic game.update = function () { if (!gameStarted) { initGame(); return; } gameTime++; // Update pet stats if (gameTime % 30 === 0) { pet.updateStats(); updateStatusBars(); } // Spawn corruption particles based on corruption level if (pet.corruption > 30 && gameTime % Math.max(5, 30 - pet.corruption / 5) === 0) { spawnCorruptionParticle(); } // Update all corruption particles for (var i = 0; i < corruptionParticles.length; i++) { corruptionParticles[i].update(); } // Random glitches when heavily corrupted if (pet.corruption > 70 && Math.random() < 0.005) { triggerGlitch(); } // Check for game over condition if (pet.corruption >= 100 && pet.hunger <= 0 && pet.happiness <= 0 && pet.cleanliness <= 0) { // Nightmare complete for (var i = 0; i < 20; i++) { LK.setTimeout(function () { triggerGlitch(); }, i * 100); } LK.setTimeout(function () { LK.showGameOver(); }, 2000); } };
===================================================================
--- original.js
+++ change.js
@@ -164,9 +164,9 @@
var mouth = self.attachAsset('petMouth', {
anchorX: 0.5,
anchorY: 0.5,
x: 0,
- y: 10
+ y: 5
});
// Food item that appears when feeding
var foodItem = self.attachAsset('food', {
anchorX: 0.5,
dirt speck. In-Game asset. 2d. High contrast. No shadows
chicken leg. In-Game asset. 2d. High contrast. No shadows
sitting cat with no eyes and mouth. In-Game asset. 2d. High contrast. No shadows
closed black cat mouth by itself. In-Game asset. 2d. High contrast. No shadows
glitch effect by itself. In-Game asset. 2d. High contrast. No shadows
ball. In-Game asset. 2d. High contrast. No shadows
vaccum. In-Game asset. 2d. High contrast. No shadows
Iphone. In-Game asset. 2d. High contrast. No shadows