Code edit (1 edits merged)
Please save this source code
User prompt
The Peacock's Feast
Initial prompt
Here is a comic strip based on your prompt: COMIC TITLE: The Peacock's Peculiar Predicament PANEL 1 Scene: A vibrant, colossal peacock, looking incredibly distended. Its throat and belly are comically engorged. The last visible part of a COW's tail is disappearing into its beak, while a LION, a SNAKE (like an anaconda), and a SHARK are clearly visible as bulges within its already impossibly swollen form. The peacock has a very satisfied, almost sleepy expression. Caption: A most ambitious appetite... PEACOCK (Thought Bubble): Mmm, a truly filling breakfast. Lion, snake, shark, and a cow for dessert! PANEL 2 Scene: The massive peacock, now even more grotesquely round, is sprawled out on a luxurious, king-sized bed in a bedroom. Pillows are squashed, blankets are ruffled. The peacock is clearly fast asleep, ZZZs emanating from its beak. Its belly is a massive, quivering mound. SFX: ZZZzzzz... SNORK... Caption: After such a Herculean meal, a nap was inevitable. PANEL 3 Scene: (CUTAWAY / X-RAY VIEW of the peacock's belly) Inside the dark, fleshy confines of the peacock's digestive system, the LION, SNAKE, SHARK, and COW are crammed together, struggling. The space is tight, and their expressions are a mix of panic and misery. LION (Speech Bubble, muffled): ROAR! It's so dark! And... damp! Let me out! SNAKE (Speech Bubble): (Coiling uncomfortably) Cannot... uncoil! Too... tight! SHARK (Speech Bubble, gurgling): G-g-gurgle! I need the ocean! Not... this feathery tomb! COW (Speech Bubble): Mooooan... I just wanted a quiet pasture... PANEL 4 Scene: Back to the sleeping peacock on the bed. Its belly is gently rumbling, and faint, almost otherworldly shimmering lines suggest intense internal activity. The peacock looks profoundly content, perhaps even smiling faintly in its sleep. SFX: GURGLE... RUMBLE... (from the belly) Caption: Oblivious to the internal turmoil, the peacock peacefully digested its impressive feast. PEACOCK (Thought Bubble, dreaming): Ahh, such comfort... Such warmth... Truly, this is the life of an apex predator. With Video And Keyboard
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Animal = Container.expand(function (type) { var self = Container.call(this); self.animalType = type; var graphics = self.attachAsset(type, { anchorX: 0.5, anchorY: 0.5 }); self.moveSpeed = 2; self.directionX = Math.random() > 0.5 ? 1 : -1; self.directionY = Math.random() > 0.5 ? 1 : -1; self.changeDirectionTimer = 0; self.update = function () { self.changeDirectionTimer++; if (self.changeDirectionTimer > 120) { self.directionX = Math.random() > 0.5 ? 1 : -1; self.directionY = Math.random() > 0.5 ? 1 : -1; self.changeDirectionTimer = 0; } self.x += self.directionX * self.moveSpeed; self.y += self.directionY * self.moveSpeed; if (self.x < 50) self.directionX = 1; if (self.x > 1998) self.directionX = -1; if (self.y < 50) self.directionY = 1; if (self.y > 2682) self.directionY = -1; }; return self; }); var Peacock = Container.expand(function () { var self = Container.call(this); self.body = self.attachAsset('peacock', { anchorX: 0.5, anchorY: 0.5 }); self.beak = self.attachAsset('peacockBeak', { anchorX: 0.5, anchorY: 0.5, x: 60, y: -20 }); self.belly = self.attachAsset('peacockBelly', { anchorX: 0.5, anchorY: 0.5, alpha: 0.7, y: 30 }); self.fullness = 0; self.maxFullness = 20; self.baseSpeed = 4; self.currentSpeed = self.baseSpeed; self.isBeakOpen = false; self.blinkTimer = 0; self.isSleeping = false; self.update = function () { var drowsinessLevel = self.fullness / self.maxFullness; self.currentSpeed = self.baseSpeed * (1 - drowsinessLevel * 0.7); self.blinkTimer++; var blinkFrequency = 180 - drowsinessLevel * 120; if (self.blinkTimer > blinkFrequency) { self.blink(); self.blinkTimer = 0; } if (self.fullness >= self.maxFullness && !self.isSleeping) { self.fallAsleep(); } }; self.blink = function () { self.body.scaleY = 0.8; tween(self.body, { scaleY: 1 }, { duration: 200 }); }; self.openBeak = function () { if (!self.isBeakOpen) { self.isBeakOpen = true; tween(self.beak, { scaleY: 1.5 }, { duration: 100 }); } }; self.closeBeak = function () { if (self.isBeakOpen) { self.isBeakOpen = false; tween(self.beak, { scaleY: 1 }, { duration: 100 }); } }; self.eatAnimal = function (animal) { self.fullness++; var bellySizeIncrease = 1 + self.fullness * 0.1; tween(self.belly, { scaleX: bellySizeIncrease, scaleY: bellySizeIncrease }, { duration: 300 }); var swallowedAnimal = new SwallowedAnimal(animal.animalType); swallowedAnimal.x = Math.random() * 80 - 40; swallowedAnimal.y = Math.random() * 60 - 30; self.belly.addChild(swallowedAnimal); LK.getSound('chomp').play(); var points = 10; if (animal.animalType === 'lion') points = 20; if (animal.animalType === 'shark') points = 15; LK.setScore(LK.getScore() + points); }; self.fallAsleep = function () { self.isSleeping = true; tween(self, { alpha: 0.8 }, { duration: 1000 }); LK.setTimeout(function () { LK.showGameOver(); }, 2000); }; return self; }); var SwallowedAnimal = Container.expand(function (type) { var self = Container.call(this); var graphics = self.attachAsset(type, { anchorX: 0.5, anchorY: 0.5, alpha: 0.6 }); self.complaintTimer = 0; self.complaintText = null; var complaints = ["Let me out!", "This is awful!", "Help me!", "I'm trapped!", "So dark in here!"]; self.update = function () { self.complaintTimer++; if (self.complaintTimer > 180 && !self.complaintText) { var complaint = complaints[Math.floor(Math.random() * complaints.length)]; self.complaintText = new Text2(complaint, { size: 30, fill: 0xFFFFFF }); self.complaintText.anchor.set(0.5, 0.5); self.complaintText.x = self.x + Math.random() * 60 - 30; self.complaintText.y = self.y - 40; self.parent.addChild(self.complaintText); LK.getSound('complaint').play(); tween(self.complaintText, { alpha: 0 }, { duration: 2000, onFinish: function onFinish() { if (self.complaintText && self.complaintText.parent) { self.complaintText.parent.removeChild(self.complaintText); } self.complaintText = null; self.complaintTimer = 0; } }); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var peacock = game.addChild(new Peacock()); peacock.x = 1024; peacock.y = 1366; var animals = []; var animalTypes = ['lion', 'snake', 'shark', 'cow']; var spawnTimer = 0; var bed = LK.getAsset('bed', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 2600 }); game.addChild(bed); var scoreText = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); var fullnessText = new Text2('Fullness: 0/20', { size: 50, fill: 0xFFFFFF }); fullnessText.anchor.set(0, 0); fullnessText.x = 50; fullnessText.y = 100; LK.gui.topLeft.addChild(fullnessText); var dragNode = null; game.down = function (x, y, obj) { if (!peacock.isSleeping) { dragNode = peacock; peacock.openBeak(); } }; game.move = function (x, y, obj) { if (dragNode && !peacock.isSleeping) { dragNode.x = x; dragNode.y = y; } }; game.up = function (x, y, obj) { if (dragNode) { peacock.closeBeak(); dragNode = null; } }; game.update = function () { if (peacock.isSleeping) return; spawnTimer++; if (spawnTimer > 120 && animals.length < 8) { var animalType = animalTypes[Math.floor(Math.random() * animalTypes.length)]; var animal = new Animal(animalType); animal.x = Math.random() * 1800 + 100; animal.y = Math.random() * 2400 + 100; animals.push(animal); game.addChild(animal); spawnTimer = 0; } for (var i = animals.length - 1; i >= 0; i--) { var animal = animals[i]; if (peacock.isBeakOpen && peacock.intersects(animal)) { peacock.eatAnimal(animal); animal.destroy(); animals.splice(i, 1); continue; } } scoreText.setText('Score: ' + LK.getScore()); fullnessText.setText('Fullness: ' + peacock.fullness + '/' + peacock.maxFullness); if (peacock.fullness >= peacock.maxFullness && !peacock.isSleeping) { peacock.y = Math.min(peacock.y + 2, 2600); } };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,256 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Animal = Container.expand(function (type) {
+ var self = Container.call(this);
+ self.animalType = type;
+ var graphics = self.attachAsset(type, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.moveSpeed = 2;
+ self.directionX = Math.random() > 0.5 ? 1 : -1;
+ self.directionY = Math.random() > 0.5 ? 1 : -1;
+ self.changeDirectionTimer = 0;
+ self.update = function () {
+ self.changeDirectionTimer++;
+ if (self.changeDirectionTimer > 120) {
+ self.directionX = Math.random() > 0.5 ? 1 : -1;
+ self.directionY = Math.random() > 0.5 ? 1 : -1;
+ self.changeDirectionTimer = 0;
+ }
+ self.x += self.directionX * self.moveSpeed;
+ self.y += self.directionY * self.moveSpeed;
+ if (self.x < 50) self.directionX = 1;
+ if (self.x > 1998) self.directionX = -1;
+ if (self.y < 50) self.directionY = 1;
+ if (self.y > 2682) self.directionY = -1;
+ };
+ return self;
+});
+var Peacock = Container.expand(function () {
+ var self = Container.call(this);
+ self.body = self.attachAsset('peacock', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.beak = self.attachAsset('peacockBeak', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 60,
+ y: -20
+ });
+ self.belly = self.attachAsset('peacockBelly', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.7,
+ y: 30
+ });
+ self.fullness = 0;
+ self.maxFullness = 20;
+ self.baseSpeed = 4;
+ self.currentSpeed = self.baseSpeed;
+ self.isBeakOpen = false;
+ self.blinkTimer = 0;
+ self.isSleeping = false;
+ self.update = function () {
+ var drowsinessLevel = self.fullness / self.maxFullness;
+ self.currentSpeed = self.baseSpeed * (1 - drowsinessLevel * 0.7);
+ self.blinkTimer++;
+ var blinkFrequency = 180 - drowsinessLevel * 120;
+ if (self.blinkTimer > blinkFrequency) {
+ self.blink();
+ self.blinkTimer = 0;
+ }
+ if (self.fullness >= self.maxFullness && !self.isSleeping) {
+ self.fallAsleep();
+ }
+ };
+ self.blink = function () {
+ self.body.scaleY = 0.8;
+ tween(self.body, {
+ scaleY: 1
+ }, {
+ duration: 200
+ });
+ };
+ self.openBeak = function () {
+ if (!self.isBeakOpen) {
+ self.isBeakOpen = true;
+ tween(self.beak, {
+ scaleY: 1.5
+ }, {
+ duration: 100
+ });
+ }
+ };
+ self.closeBeak = function () {
+ if (self.isBeakOpen) {
+ self.isBeakOpen = false;
+ tween(self.beak, {
+ scaleY: 1
+ }, {
+ duration: 100
+ });
+ }
+ };
+ self.eatAnimal = function (animal) {
+ self.fullness++;
+ var bellySizeIncrease = 1 + self.fullness * 0.1;
+ tween(self.belly, {
+ scaleX: bellySizeIncrease,
+ scaleY: bellySizeIncrease
+ }, {
+ duration: 300
+ });
+ var swallowedAnimal = new SwallowedAnimal(animal.animalType);
+ swallowedAnimal.x = Math.random() * 80 - 40;
+ swallowedAnimal.y = Math.random() * 60 - 30;
+ self.belly.addChild(swallowedAnimal);
+ LK.getSound('chomp').play();
+ var points = 10;
+ if (animal.animalType === 'lion') points = 20;
+ if (animal.animalType === 'shark') points = 15;
+ LK.setScore(LK.getScore() + points);
+ };
+ self.fallAsleep = function () {
+ self.isSleeping = true;
+ tween(self, {
+ alpha: 0.8
+ }, {
+ duration: 1000
+ });
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 2000);
+ };
+ return self;
+});
+var SwallowedAnimal = Container.expand(function (type) {
+ var self = Container.call(this);
+ var graphics = self.attachAsset(type, {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.6
+ });
+ self.complaintTimer = 0;
+ self.complaintText = null;
+ var complaints = ["Let me out!", "This is awful!", "Help me!", "I'm trapped!", "So dark in here!"];
+ self.update = function () {
+ self.complaintTimer++;
+ if (self.complaintTimer > 180 && !self.complaintText) {
+ var complaint = complaints[Math.floor(Math.random() * complaints.length)];
+ self.complaintText = new Text2(complaint, {
+ size: 30,
+ fill: 0xFFFFFF
+ });
+ self.complaintText.anchor.set(0.5, 0.5);
+ self.complaintText.x = self.x + Math.random() * 60 - 30;
+ self.complaintText.y = self.y - 40;
+ self.parent.addChild(self.complaintText);
+ LK.getSound('complaint').play();
+ tween(self.complaintText, {
+ alpha: 0
+ }, {
+ duration: 2000,
+ onFinish: function onFinish() {
+ if (self.complaintText && self.complaintText.parent) {
+ self.complaintText.parent.removeChild(self.complaintText);
+ }
+ self.complaintText = null;
+ self.complaintTimer = 0;
+ }
+ });
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB
+});
+
+/****
+* Game Code
+****/
+var peacock = game.addChild(new Peacock());
+peacock.x = 1024;
+peacock.y = 1366;
+var animals = [];
+var animalTypes = ['lion', 'snake', 'shark', 'cow'];
+var spawnTimer = 0;
+var bed = LK.getAsset('bed', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 2600
+});
+game.addChild(bed);
+var scoreText = new Text2('Score: 0', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+scoreText.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreText);
+var fullnessText = new Text2('Fullness: 0/20', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+fullnessText.anchor.set(0, 0);
+fullnessText.x = 50;
+fullnessText.y = 100;
+LK.gui.topLeft.addChild(fullnessText);
+var dragNode = null;
+game.down = function (x, y, obj) {
+ if (!peacock.isSleeping) {
+ dragNode = peacock;
+ peacock.openBeak();
+ }
+};
+game.move = function (x, y, obj) {
+ if (dragNode && !peacock.isSleeping) {
+ dragNode.x = x;
+ dragNode.y = y;
+ }
+};
+game.up = function (x, y, obj) {
+ if (dragNode) {
+ peacock.closeBeak();
+ dragNode = null;
+ }
+};
+game.update = function () {
+ if (peacock.isSleeping) return;
+ spawnTimer++;
+ if (spawnTimer > 120 && animals.length < 8) {
+ var animalType = animalTypes[Math.floor(Math.random() * animalTypes.length)];
+ var animal = new Animal(animalType);
+ animal.x = Math.random() * 1800 + 100;
+ animal.y = Math.random() * 2400 + 100;
+ animals.push(animal);
+ game.addChild(animal);
+ spawnTimer = 0;
+ }
+ for (var i = animals.length - 1; i >= 0; i--) {
+ var animal = animals[i];
+ if (peacock.isBeakOpen && peacock.intersects(animal)) {
+ peacock.eatAnimal(animal);
+ animal.destroy();
+ animals.splice(i, 1);
+ continue;
+ }
+ }
+ scoreText.setText('Score: ' + LK.getScore());
+ fullnessText.setText('Fullness: ' + peacock.fullness + '/' + peacock.maxFullness);
+ if (peacock.fullness >= peacock.maxFullness && !peacock.isSleeping) {
+ peacock.y = Math.min(peacock.y + 2, 2600);
+ }
+};
\ No newline at end of file