User prompt
Make pancakes spawn more over time
User prompt
Add music
User prompt
Add a background asset which is th background instead of just a colo
User prompt
Make the pancakes stay raw for 0.5 seconds and it never decreases
User prompt
I cant see the burnt pancakes
User prompt
When the pancakes burn they should not disappear instantly they should disappear after 4 seconds ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
I did not mean to break all hearts at once, also add a different asset for the broken heart
User prompt
Add five hearts in the top left corner and if you let a pancake burn then one heart will break, breaking all hearts makes gameover
User prompt
Make pancakes golden duration lower every 4 seconds
User prompt
Make the game a lot easier by keeping pancakes golden for a longer time
User prompt
Make the pancakes early for a longer time
User prompt
Make the game infinite and remove timer
User prompt
Make pancakes stay golden for 0.6 seconds but get faster over time
User prompt
Add a sound when you flip pancake too early
User prompt
Make the pancakes need more time to burn
User prompt
Pancakes cook slow at start but get faster over time
Code edit (1 edits merged)
Please save this source code
User prompt
Pancake Rush
Initial prompt
Pancake maker where you make pancakes as fast as you can.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Pancake = Container.expand(function () { var self = Container.call(this); // Cooking states: 0=raw, 1=cooking, 2=golden, 3=burnt self.cookingState = 0; self.flipped = false; self.cookingSpeed = 0.02; // How fast pancake cooks per frame self.cookingProgress = 0; // 0 to 1 self.isActive = true; // Create visual representation var pancakeGraphic = self.attachAsset('pancake_raw', { anchorX: 0.5, anchorY: 0.5 }); self.updateVisual = function () { self.removeChildren(); var assetName = 'pancake_raw'; if (self.cookingState === 0) assetName = 'pancake_raw';else if (self.cookingState === 1) assetName = 'pancake_cooking';else if (self.cookingState === 2) assetName = 'pancake_golden';else if (self.cookingState === 3) assetName = 'pancake_burnt'; pancakeGraphic = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5 }); }; self.update = function () { if (!self.isActive) return; // Cook the pancake self.cookingProgress += self.cookingSpeed; // Update cooking state based on progress var newState = self.cookingState; if (self.cookingProgress >= 0.8) newState = 3; // burnt else if (self.cookingProgress >= 0.5) newState = 2; // golden else if (self.cookingProgress >= 0.2) newState = 1; // cooking if (newState !== self.cookingState) { self.cookingState = newState; self.updateVisual(); if (self.cookingState === 3) { // Pancake burnt LK.getSound('burn').play(); LK.effects.flashObject(self, 0xff0000, 500); } } }; self.flip = function () { if (!self.isActive || self.flipped) return false; self.flipped = true; self.isActive = false; // Flip animation tween(self, { scaleY: 0 }, { duration: 150, onFinish: function onFinish() { tween(self, { scaleY: 1 }, { duration: 150 }); } }); LK.getSound('flip').play(); // Calculate score based on timing var score = 0; if (self.cookingState === 2) { // Perfect golden pancake score = 100; LK.getSound('perfect').play(); LK.effects.flashObject(self, 0x00ff00, 300); } else if (self.cookingState === 1) { // Good timing but not perfect score = 50; } else if (self.cookingState === 0) { // Too early score = 10; } else { // Burnt - no points score = 0; } return score; }; self.down = function (x, y, obj) { if (self.isActive && !self.flipped) { var earnedScore = self.flip(); LK.setScore(LK.getScore() + earnedScore); scoreTxt.setText(LK.getScore()); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x8B4513 }); /**** * Game Code ****/ var griddle = game.addChild(LK.getAsset('griddle', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 })); var pancakes = []; var gameTime = 60; // 60 seconds var timeLeft = gameTime; var pancakeSpawnRate = 120; // frames between pancake spawns var maxPancakes = 6; // UI Elements var scoreTxt = new Text2('Score: 0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var timeTxt = new Text2('Time: 60', { size: 80, fill: 0xFFFFFF }); timeTxt.anchor.set(0.5, 0); timeTxt.y = 100; LK.gui.top.addChild(timeTxt); var instructionTxt = new Text2('Tap pancakes when golden!', { size: 60, fill: 0xFFFF00 }); instructionTxt.anchor.set(0.5, 1); LK.gui.bottom.addChild(instructionTxt); // Timer countdown var gameTimer = LK.setInterval(function () { timeLeft--; timeTxt.setText('Time: ' + timeLeft); if (timeLeft <= 0) { LK.clearInterval(gameTimer); LK.showGameOver(); } }, 1000); function spawnPancake() { if (pancakes.length >= maxPancakes) return; var pancake = new Pancake(); // Position pancake on griddle var griddleLeft = griddle.x - griddle.width * 0.4; var griddleRight = griddle.x + griddle.width * 0.4; var griddleTop = griddle.y - griddle.height * 0.3; var griddleBottom = griddle.y + griddle.height * 0.3; pancake.x = griddleLeft + Math.random() * (griddleRight - griddleLeft); pancake.y = griddleTop + Math.random() * (griddleBottom - griddleTop); // Vary cooking speed slightly for difficulty pancake.cookingSpeed = 0.015 + Math.random() * 0.01; pancakes.push(pancake); game.addChild(pancake); // Entry animation pancake.scaleX = 0; pancake.scaleY = 0; tween(pancake, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.bounceOut }); } game.update = function () { // Spawn new pancakes if (LK.ticks % pancakeSpawnRate === 0 && timeLeft > 0) { spawnPancake(); } // Clean up finished pancakes for (var i = pancakes.length - 1; i >= 0; i--) { var pancake = pancakes[i]; if (pancake.flipped || pancake.cookingState === 3) { // Remove pancake after delay if (!pancake.removeTimer) { pancake.removeTimer = LK.setTimeout(function () { if (pancake.parent) { pancake.destroy(); } }, 2000); pancakes.splice(i, 1); } } } // Increase difficulty over time if (LK.ticks % 1800 === 0 && pancakeSpawnRate > 60) { // Every 30 seconds pancakeSpawnRate -= 10; if (maxPancakes < 8) maxPancakes++; } // Update score display scoreTxt.setText('Score: ' + LK.getScore()); }; // Initial pancake spawn LK.setTimeout(function () { spawnPancake(); }, 500);
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,204 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Pancake = Container.expand(function () {
+ var self = Container.call(this);
+ // Cooking states: 0=raw, 1=cooking, 2=golden, 3=burnt
+ self.cookingState = 0;
+ self.flipped = false;
+ self.cookingSpeed = 0.02; // How fast pancake cooks per frame
+ self.cookingProgress = 0; // 0 to 1
+ self.isActive = true;
+ // Create visual representation
+ var pancakeGraphic = self.attachAsset('pancake_raw', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.updateVisual = function () {
+ self.removeChildren();
+ var assetName = 'pancake_raw';
+ if (self.cookingState === 0) assetName = 'pancake_raw';else if (self.cookingState === 1) assetName = 'pancake_cooking';else if (self.cookingState === 2) assetName = 'pancake_golden';else if (self.cookingState === 3) assetName = 'pancake_burnt';
+ pancakeGraphic = self.attachAsset(assetName, {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ };
+ self.update = function () {
+ if (!self.isActive) return;
+ // Cook the pancake
+ self.cookingProgress += self.cookingSpeed;
+ // Update cooking state based on progress
+ var newState = self.cookingState;
+ if (self.cookingProgress >= 0.8) newState = 3; // burnt
+ else if (self.cookingProgress >= 0.5) newState = 2; // golden
+ else if (self.cookingProgress >= 0.2) newState = 1; // cooking
+ if (newState !== self.cookingState) {
+ self.cookingState = newState;
+ self.updateVisual();
+ if (self.cookingState === 3) {
+ // Pancake burnt
+ LK.getSound('burn').play();
+ LK.effects.flashObject(self, 0xff0000, 500);
+ }
+ }
+ };
+ self.flip = function () {
+ if (!self.isActive || self.flipped) return false;
+ self.flipped = true;
+ self.isActive = false;
+ // Flip animation
+ tween(self, {
+ scaleY: 0
+ }, {
+ duration: 150,
+ onFinish: function onFinish() {
+ tween(self, {
+ scaleY: 1
+ }, {
+ duration: 150
+ });
+ }
+ });
+ LK.getSound('flip').play();
+ // Calculate score based on timing
+ var score = 0;
+ if (self.cookingState === 2) {
+ // Perfect golden pancake
+ score = 100;
+ LK.getSound('perfect').play();
+ LK.effects.flashObject(self, 0x00ff00, 300);
+ } else if (self.cookingState === 1) {
+ // Good timing but not perfect
+ score = 50;
+ } else if (self.cookingState === 0) {
+ // Too early
+ score = 10;
+ } else {
+ // Burnt - no points
+ score = 0;
+ }
+ return score;
+ };
+ self.down = function (x, y, obj) {
+ if (self.isActive && !self.flipped) {
+ var earnedScore = self.flip();
+ LK.setScore(LK.getScore() + earnedScore);
+ scoreTxt.setText(LK.getScore());
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x8B4513
+});
+
+/****
+* Game Code
+****/
+var griddle = game.addChild(LK.getAsset('griddle', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 2,
+ y: 2732 / 2
+}));
+var pancakes = [];
+var gameTime = 60; // 60 seconds
+var timeLeft = gameTime;
+var pancakeSpawnRate = 120; // frames between pancake spawns
+var maxPancakes = 6;
+// UI Elements
+var scoreTxt = new Text2('Score: 0', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+var timeTxt = new Text2('Time: 60', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+timeTxt.anchor.set(0.5, 0);
+timeTxt.y = 100;
+LK.gui.top.addChild(timeTxt);
+var instructionTxt = new Text2('Tap pancakes when golden!', {
+ size: 60,
+ fill: 0xFFFF00
+});
+instructionTxt.anchor.set(0.5, 1);
+LK.gui.bottom.addChild(instructionTxt);
+// Timer countdown
+var gameTimer = LK.setInterval(function () {
+ timeLeft--;
+ timeTxt.setText('Time: ' + timeLeft);
+ if (timeLeft <= 0) {
+ LK.clearInterval(gameTimer);
+ LK.showGameOver();
+ }
+}, 1000);
+function spawnPancake() {
+ if (pancakes.length >= maxPancakes) return;
+ var pancake = new Pancake();
+ // Position pancake on griddle
+ var griddleLeft = griddle.x - griddle.width * 0.4;
+ var griddleRight = griddle.x + griddle.width * 0.4;
+ var griddleTop = griddle.y - griddle.height * 0.3;
+ var griddleBottom = griddle.y + griddle.height * 0.3;
+ pancake.x = griddleLeft + Math.random() * (griddleRight - griddleLeft);
+ pancake.y = griddleTop + Math.random() * (griddleBottom - griddleTop);
+ // Vary cooking speed slightly for difficulty
+ pancake.cookingSpeed = 0.015 + Math.random() * 0.01;
+ pancakes.push(pancake);
+ game.addChild(pancake);
+ // Entry animation
+ pancake.scaleX = 0;
+ pancake.scaleY = 0;
+ tween(pancake, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 300,
+ easing: tween.bounceOut
+ });
+}
+game.update = function () {
+ // Spawn new pancakes
+ if (LK.ticks % pancakeSpawnRate === 0 && timeLeft > 0) {
+ spawnPancake();
+ }
+ // Clean up finished pancakes
+ for (var i = pancakes.length - 1; i >= 0; i--) {
+ var pancake = pancakes[i];
+ if (pancake.flipped || pancake.cookingState === 3) {
+ // Remove pancake after delay
+ if (!pancake.removeTimer) {
+ pancake.removeTimer = LK.setTimeout(function () {
+ if (pancake.parent) {
+ pancake.destroy();
+ }
+ }, 2000);
+ pancakes.splice(i, 1);
+ }
+ }
+ }
+ // Increase difficulty over time
+ if (LK.ticks % 1800 === 0 && pancakeSpawnRate > 60) {
+ // Every 30 seconds
+ pancakeSpawnRate -= 10;
+ if (maxPancakes < 8) maxPancakes++;
+ }
+ // Update score display
+ scoreTxt.setText('Score: ' + LK.getScore());
+};
+// Initial pancake spawn
+LK.setTimeout(function () {
+ spawnPancake();
+}, 500);
\ No newline at end of file
1800x400 not rotated not rounded Griddle. In-Game asset. 2d. 2d 2d 2d topdown view topdown view High contrast. No shadows
A pancake that has started cooking. Transparent transparent 2d 2d 2d topdown view topdown view. In-Game asset. 2d. High contrast. No shadows
Golden pancake transparent transparent 2d 2d 2d 2d 2d 2d 2d topdown view topdown view topdown view. In-Game asset. 2d. High contrast. No shadows
Burnt pancake 2d 2d topdown view topdown view. In-Game asset. 2d. High contrast. No shadows
Raw pancake perfect circle 2d 2d 2d topdown view topdown view. In-Game asset. 2d. High contrast. No shadows
Heart. In-Game asset. 2d. High contrast. No shadows
2048x2732 kitchen table background. In-Game asset. 2d. High contrast. No shadows
Broken heart with a little shadows. In-Game asset. 2d. High contrast. No shadows