Code edit (1 edits merged)
Please save this source code
User prompt
Hen House Feast Frenzy
Initial prompt
Okay, here's a comic strip based on your prompt. It's a bit absurd, but hopefully captures the weirdness! Panel 1 Setting: A sunny farmyard. A large, muscular sheep and a rotund hippo stand nervously. A seemingly normal-sized hen stands before them, looking very determined. Visual: The sheep is sweating and wide-eyed. The hippo is trembling slightly. The hen is puffed up, looking directly at them. Caption: Bartholomew the Hen had a peculiar dietary goal. Hen (Speech balloon): "Alright, you two! Prepare to be... DIGESTED!" Panel 2 Setting: Slightly closer view of the hen. Her beak is wide open, and she's emitting a strange, shimmering light. Visual: The sheep and hippo are being pulled towards the hen. Sheep (Speech balloon): "Wait! But...you're so small!" Hippo (Speech balloon): "This defies all known logic!!" Panel 3 Setting: An abstract, swirling vortex of colors. Visual: Inside the vortex, simplified representations of the sheep and hippo are being broken down into smaller shapes and bits of grass. Caption: Inside Bartholomew, the process began. He was not simply eating them; he was becoming them... Panel 4 Setting: The farmyard from Panel 1, but the hen is now HUGE and VERY lumpy. She's clearly struggling to contain the digested sheep and hippo. Visual: The hen is bulging with sheep and hippo shapes under her feathers. She's straining. There is a slight crack appearing on the stomach. Hen (Speech balloon - strained): "Urgh... almost... got... to expel..." Panel 5 Setting: The farmyard again. Bartholomew is now back to her original size, but there are sheep and Hippo droppings. Visual: The environment around the hen is covered by feces. The hen is standing on top of the dropping. Caption: "With the help of his diet, he finally get out!" With Video Panel 5 And Keyboard
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var FarmAnimal = Container.expand(function (animalType) { var self = Container.call(this); self.animalType = animalType || 'sheep'; self.points = animalType === 'sheep' ? 10 : animalType === 'cow' ? 20 : 30; self.size = animalType === 'sheep' ? 1 : animalType === 'cow' ? 1.5 : 2; var animalGraphics = self.attachAsset(self.animalType, { anchorX: 0.5, anchorY: 0.5 }); self.isBeingSwallowed = false; return self; }); var Fertilizer = Container.expand(function () { var self = Container.call(this); var fertilizerGraphics = self.attachAsset('fertilizer', { anchorX: 0.5, anchorY: 0.5 }); // Slight animation when created tween(self, { scaleX: 1.2, scaleY: 1.2 }, { duration: 200, onFinish: function onFinish() { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); return self; }); var Hen = Container.expand(function () { var self = Container.call(this); self.isBloated = false; self.stomachContents = []; self.totalSize = 0; self.moveSpeed = 8; self.canSwallow = true; self.swallowCooldown = 0; var henGraphics = self.attachAsset('hen', { anchorX: 0.5, anchorY: 0.5 }); self.bloatedGraphics = null; self.update = function () { if (self.swallowCooldown > 0) { self.swallowCooldown--; } else { self.canSwallow = true; } // Reduced speed when bloated var speedMultiplier = self.isBloated ? Math.max(0.3, 1 - self.totalSize * 0.2) : 1; self.currentSpeed = self.moveSpeed * speedMultiplier; }; self.swallowAnimal = function (animal) { if (!self.canSwallow || animal.isBeingSwallowed) return false; self.stomachContents.push(animal); self.totalSize += animal.size; if (!self.isBloated) { self.isBloated = true; henGraphics.visible = false; self.bloatedGraphics = self.attachAsset('henBloated', { anchorX: 0.5, anchorY: 0.5 }); } // Scale bloated hen based on contents if (self.bloatedGraphics) { var scale = 1 + self.totalSize * 0.3; self.bloatedGraphics.scaleX = scale; self.bloatedGraphics.scaleY = scale; } animal.isBeingSwallowed = true; tween(animal, { alpha: 0, scaleX: 0.1, scaleY: 0.1 }, { duration: 500, onFinish: function onFinish() { animal.destroy(); } }); LK.getSound('swallow').play(); self.canSwallow = false; self.swallowCooldown = 60; // 1 second cooldown return true; }; self.expelContents = function () { if (self.stomachContents.length === 0) return; var totalPoints = 0; for (var i = 0; i < self.stomachContents.length; i++) { totalPoints += self.stomachContents[i].points; } // Create fertilizer drops around the hen var numDrops = Math.min(8, self.stomachContents.length * 2); for (var j = 0; j < numDrops; j++) { var angle = j / numDrops * Math.PI * 2; var distance = 80 + Math.random() * 60; var dropX = self.x + Math.cos(angle) * distance; var dropY = self.y + Math.sin(angle) * distance; var fertilizer = new Fertilizer(); fertilizer.x = dropX; fertilizer.y = dropY; fertilizerDrops.push(fertilizer); game.addChild(fertilizer); } LK.setScore(LK.getScore() + totalPoints); scoreText.setText('Score: ' + LK.getScore()); // Reset hen to normal self.stomachContents = []; self.totalSize = 0; self.isBloated = false; if (self.bloatedGraphics) { self.bloatedGraphics.destroy(); self.bloatedGraphics = null; } henGraphics.visible = true; LK.getSound('drop').play(); // Check win condition if (fertilizerDrops.length >= 50) { LK.showYouWin(); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ // Game variables var hen; var farmAnimals = []; var fertilizerDrops = []; var animalSpawnTimer = 0; var gameTimer = 0; var maxGameTime = 3600; // 60 seconds at 60fps var dragNode = null; // Create ground var ground = game.addChild(LK.getAsset('ground', { anchorX: 0, anchorY: 0, x: 0, y: 2632 })); // Create hen hen = game.addChild(new Hen()); hen.x = 1024; hen.y = 2500; // Create UI var scoreText = new Text2('Score: 0', { size: 60, fill: 0x000000 }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); var timerText = new Text2('Time: 60', { size: 50, fill: 0x000000 }); timerText.anchor.set(1, 0); LK.gui.topRight.addChild(timerText); var instructionText = new Text2('Drag to move, tap to expel!', { size: 40, fill: 0x000000 }); instructionText.anchor.set(0.5, 0); instructionText.y = 100; LK.gui.top.addChild(instructionText); // Spawn initial animals function spawnAnimal() { var animalTypes = ['sheep', 'cow', 'hippo']; var animalType = animalTypes[Math.floor(Math.random() * animalTypes.length)]; var animal = new FarmAnimal(animalType); animal.x = Math.random() * 1800 + 124; // Keep away from edges animal.y = Math.random() * 2000 + 200; // Keep in playable area farmAnimals.push(animal); game.addChild(animal); } // Initial spawn for (var i = 0; i < 8; i++) { spawnAnimal(); } // Event handlers function handleMove(x, y, obj) { if (dragNode) { dragNode.x = x; dragNode.y = Math.min(y, 2580); // Keep hen above ground } } game.move = handleMove; game.down = function (x, y, obj) { var henBounds = hen.getBounds(); if (x >= henBounds.x && x <= henBounds.x + henBounds.width && y >= henBounds.y && y <= henBounds.y + henBounds.height) { if (hen.isBloated) { hen.expelContents(); } else { dragNode = hen; handleMove(x, y, obj); } } }; game.up = function (x, y, obj) { dragNode = null; }; // Main game loop game.update = function () { gameTimer++; var remainingTime = Math.max(0, Math.ceil((maxGameTime - gameTimer) / 60)); timerText.setText('Time: ' + remainingTime); if (gameTimer >= maxGameTime) { LK.showGameOver(); return; } // Spawn new animals periodically animalSpawnTimer++; if (animalSpawnTimer >= 240 && farmAnimals.length < 12) { // Every 4 seconds spawnAnimal(); animalSpawnTimer = 0; } // Check for swallow interactions if (!hen.isBloated || hen.stomachContents.length < 3) { for (var i = farmAnimals.length - 1; i >= 0; i--) { var animal = farmAnimals[i]; if (!animal.isBeingSwallowed && hen.intersects(animal)) { if (hen.swallowAnimal(animal)) { farmAnimals.splice(i, 1); } } } } // Clean up destroyed animals for (var j = farmAnimals.length - 1; j >= 0; j--) { if (farmAnimals[j].isBeingSwallowed && farmAnimals[j].alpha <= 0) { farmAnimals.splice(j, 1); } } };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,258 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var FarmAnimal = Container.expand(function (animalType) {
+ var self = Container.call(this);
+ self.animalType = animalType || 'sheep';
+ self.points = animalType === 'sheep' ? 10 : animalType === 'cow' ? 20 : 30;
+ self.size = animalType === 'sheep' ? 1 : animalType === 'cow' ? 1.5 : 2;
+ var animalGraphics = self.attachAsset(self.animalType, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.isBeingSwallowed = false;
+ return self;
+});
+var Fertilizer = Container.expand(function () {
+ var self = Container.call(this);
+ var fertilizerGraphics = self.attachAsset('fertilizer', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Slight animation when created
+ tween(self, {
+ scaleX: 1.2,
+ scaleY: 1.2
+ }, {
+ duration: 200,
+ onFinish: function onFinish() {
+ tween(self, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 200
+ });
+ }
+ });
+ return self;
+});
+var Hen = Container.expand(function () {
+ var self = Container.call(this);
+ self.isBloated = false;
+ self.stomachContents = [];
+ self.totalSize = 0;
+ self.moveSpeed = 8;
+ self.canSwallow = true;
+ self.swallowCooldown = 0;
+ var henGraphics = self.attachAsset('hen', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.bloatedGraphics = null;
+ self.update = function () {
+ if (self.swallowCooldown > 0) {
+ self.swallowCooldown--;
+ } else {
+ self.canSwallow = true;
+ }
+ // Reduced speed when bloated
+ var speedMultiplier = self.isBloated ? Math.max(0.3, 1 - self.totalSize * 0.2) : 1;
+ self.currentSpeed = self.moveSpeed * speedMultiplier;
+ };
+ self.swallowAnimal = function (animal) {
+ if (!self.canSwallow || animal.isBeingSwallowed) return false;
+ self.stomachContents.push(animal);
+ self.totalSize += animal.size;
+ if (!self.isBloated) {
+ self.isBloated = true;
+ henGraphics.visible = false;
+ self.bloatedGraphics = self.attachAsset('henBloated', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ }
+ // Scale bloated hen based on contents
+ if (self.bloatedGraphics) {
+ var scale = 1 + self.totalSize * 0.3;
+ self.bloatedGraphics.scaleX = scale;
+ self.bloatedGraphics.scaleY = scale;
+ }
+ animal.isBeingSwallowed = true;
+ tween(animal, {
+ alpha: 0,
+ scaleX: 0.1,
+ scaleY: 0.1
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ animal.destroy();
+ }
+ });
+ LK.getSound('swallow').play();
+ self.canSwallow = false;
+ self.swallowCooldown = 60; // 1 second cooldown
+ return true;
+ };
+ self.expelContents = function () {
+ if (self.stomachContents.length === 0) return;
+ var totalPoints = 0;
+ for (var i = 0; i < self.stomachContents.length; i++) {
+ totalPoints += self.stomachContents[i].points;
+ }
+ // Create fertilizer drops around the hen
+ var numDrops = Math.min(8, self.stomachContents.length * 2);
+ for (var j = 0; j < numDrops; j++) {
+ var angle = j / numDrops * Math.PI * 2;
+ var distance = 80 + Math.random() * 60;
+ var dropX = self.x + Math.cos(angle) * distance;
+ var dropY = self.y + Math.sin(angle) * distance;
+ var fertilizer = new Fertilizer();
+ fertilizer.x = dropX;
+ fertilizer.y = dropY;
+ fertilizerDrops.push(fertilizer);
+ game.addChild(fertilizer);
+ }
+ LK.setScore(LK.getScore() + totalPoints);
+ scoreText.setText('Score: ' + LK.getScore());
+ // Reset hen to normal
+ self.stomachContents = [];
+ self.totalSize = 0;
+ self.isBloated = false;
+ if (self.bloatedGraphics) {
+ self.bloatedGraphics.destroy();
+ self.bloatedGraphics = null;
+ }
+ henGraphics.visible = true;
+ LK.getSound('drop').play();
+ // Check win condition
+ if (fertilizerDrops.length >= 50) {
+ LK.showYouWin();
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB
+});
+
+/****
+* Game Code
+****/
+// Game variables
+var hen;
+var farmAnimals = [];
+var fertilizerDrops = [];
+var animalSpawnTimer = 0;
+var gameTimer = 0;
+var maxGameTime = 3600; // 60 seconds at 60fps
+var dragNode = null;
+// Create ground
+var ground = game.addChild(LK.getAsset('ground', {
+ anchorX: 0,
+ anchorY: 0,
+ x: 0,
+ y: 2632
+}));
+// Create hen
+hen = game.addChild(new Hen());
+hen.x = 1024;
+hen.y = 2500;
+// Create UI
+var scoreText = new Text2('Score: 0', {
+ size: 60,
+ fill: 0x000000
+});
+scoreText.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreText);
+var timerText = new Text2('Time: 60', {
+ size: 50,
+ fill: 0x000000
+});
+timerText.anchor.set(1, 0);
+LK.gui.topRight.addChild(timerText);
+var instructionText = new Text2('Drag to move, tap to expel!', {
+ size: 40,
+ fill: 0x000000
+});
+instructionText.anchor.set(0.5, 0);
+instructionText.y = 100;
+LK.gui.top.addChild(instructionText);
+// Spawn initial animals
+function spawnAnimal() {
+ var animalTypes = ['sheep', 'cow', 'hippo'];
+ var animalType = animalTypes[Math.floor(Math.random() * animalTypes.length)];
+ var animal = new FarmAnimal(animalType);
+ animal.x = Math.random() * 1800 + 124; // Keep away from edges
+ animal.y = Math.random() * 2000 + 200; // Keep in playable area
+ farmAnimals.push(animal);
+ game.addChild(animal);
+}
+// Initial spawn
+for (var i = 0; i < 8; i++) {
+ spawnAnimal();
+}
+// Event handlers
+function handleMove(x, y, obj) {
+ if (dragNode) {
+ dragNode.x = x;
+ dragNode.y = Math.min(y, 2580); // Keep hen above ground
+ }
+}
+game.move = handleMove;
+game.down = function (x, y, obj) {
+ var henBounds = hen.getBounds();
+ if (x >= henBounds.x && x <= henBounds.x + henBounds.width && y >= henBounds.y && y <= henBounds.y + henBounds.height) {
+ if (hen.isBloated) {
+ hen.expelContents();
+ } else {
+ dragNode = hen;
+ handleMove(x, y, obj);
+ }
+ }
+};
+game.up = function (x, y, obj) {
+ dragNode = null;
+};
+// Main game loop
+game.update = function () {
+ gameTimer++;
+ var remainingTime = Math.max(0, Math.ceil((maxGameTime - gameTimer) / 60));
+ timerText.setText('Time: ' + remainingTime);
+ if (gameTimer >= maxGameTime) {
+ LK.showGameOver();
+ return;
+ }
+ // Spawn new animals periodically
+ animalSpawnTimer++;
+ if (animalSpawnTimer >= 240 && farmAnimals.length < 12) {
+ // Every 4 seconds
+ spawnAnimal();
+ animalSpawnTimer = 0;
+ }
+ // Check for swallow interactions
+ if (!hen.isBloated || hen.stomachContents.length < 3) {
+ for (var i = farmAnimals.length - 1; i >= 0; i--) {
+ var animal = farmAnimals[i];
+ if (!animal.isBeingSwallowed && hen.intersects(animal)) {
+ if (hen.swallowAnimal(animal)) {
+ farmAnimals.splice(i, 1);
+ }
+ }
+ }
+ }
+ // Clean up destroyed animals
+ for (var j = farmAnimals.length - 1; j >= 0; j--) {
+ if (farmAnimals[j].isBeingSwallowed && farmAnimals[j].alpha <= 0) {
+ farmAnimals.splice(j, 1);
+ }
+ }
+};
\ No newline at end of file