User prompt
Kazanmadan önce 2 saniye Devamı gelecekde ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
fruit 2 3 4 5 200M de karşılaşalım
User prompt
mr patatesi göremiyoruz yanımıza gelip desin sonra 200m fruit 2 3 4 5 kurtaralım
User prompt
mr patatesle boss figth yapmayalım önümüze çıkıp kardeşlerin elimde diyip aşağı atlasın
User prompt
ve Mr patatesle savaşırken altında platform olsun
User prompt
Mr Patatesle kavga ederken karakter sabit dursun
User prompt
düşünce balonunu sil
User prompt
düşünce balonu assetsini ilk haline getir
User prompt
düşüünce balonuyla yazıyı ortala
User prompt
123 de karşımıza Mr.Patates çıksın onla dövüşelim ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
distance 90 da Onları MR.Patatese vermiyecektim yzsın
User prompt
distance 30 da düşünce baloncuğu içinde -Kardeşlerimi Bulacağım
User prompt
hepsinin altında düz platform olsun
User prompt
fruit 2 3 4 5 sıralı bir şekilde bizi beklisin yan yana
User prompt
az önce verdiğim komudu sil
User prompt
fruit 2 3 4 5 alınablir olmasın onların yanına gelince oyun bitsin
User prompt
menüyü sil
User prompt
play bottonunu assets e ekle
User prompt
Menü ekle
User prompt
fruitlerin hepsinin assetsleri olsun yanalırna gelince oyun bitsin
User prompt
Distance 145 de bitişe gelelim bitişte bizi Fruit 2 3 4 5 olsun
User prompt
3 zıplama
User prompt
level mantığını kaldır
User prompt
level 2 background farklı olsun
User prompt
level 1 de bıçak olmasın
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var FinishFruit = Container.expand(function () { var self = Container.call(this); self.speed = -3; self.lastX = 0; self.lastIntersecting = false; self.number = 2; // Will be set when created self.fruitGraphics = null; // Will be set based on number self.setNumber = function (num) { self.number = num; // Remove existing graphics if any if (self.fruitGraphics) { self.removeChild(self.fruitGraphics); } // Add appropriate fruit asset based on number var assetName = 'fruit' + num; self.fruitGraphics = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5 }); }; self.update = function () { self.lastX = self.x; self.x += self.speed; }; return self; }); var Fruit = Container.expand(function () { var self = Container.call(this); var fruitGraphics = self.attachAsset('fruit', { anchorX: 0.5, anchorY: 0.5 }); self.velocityY = 0; self.gravity = 0.8; self.jumpPower = -18; self.isOnGround = false; self.lastY = 0; self.jumpCount = 0; self.maxJumps = 3; self.jump = function () { if (self.jumpCount < self.maxJumps) { self.velocityY = self.jumpPower; self.jumpCount++; if (self.jumpCount === 1) { self.isOnGround = false; } LK.getSound('jump').play(); } }; self.update = function () { self.lastY = self.y; self.velocityY += self.gravity; self.y += self.velocityY; // No ground collision safety - let fruit fall through }; return self; }); var JuiceDrop = Container.expand(function () { var self = Container.call(this); var dropGraphics = self.attachAsset('juiceDrop', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -4; self.lastX = 0; self.lastIntersecting = false; self.update = function () { self.lastX = self.x; self.x += self.speed; }; return self; }); var Knife = Container.expand(function () { var self = Container.call(this); var knifeGraphics = self.attachAsset('knife', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -8; self.lastX = 0; self.lastIntersecting = false; self.update = function () { self.lastX = self.x; self.x += self.speed; }; return self; }); var Platform = Container.expand(function () { var self = Container.call(this); var platformGraphics = self.attachAsset('platform', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -3; self.lastX = 0; self.update = function () { self.lastX = self.x; self.x += self.speed; }; return self; }); var ThoughtBubble = Container.expand(function () { var self = Container.call(this); // Create bubble background var bubbleGraphics = self.attachAsset('thoughtBubble', { anchorX: 0.5, anchorY: 0.5 }); bubbleGraphics.alpha = 0.9; // Create text var bubbleText = new Text2('-Kardeşlerimi Bulacağım', { size: 45, fill: 0x000000 }); bubbleText.anchor.set(0.5, 0.5); self.addChild(bubbleText); // Animation properties self.fadeTimer = 0; self.displayDuration = 180; // 3 seconds at 60fps self.isVisible = true; self.update = function () { self.fadeTimer++; // Fade out after display duration if (self.fadeTimer > self.displayDuration) { self.alpha = Math.max(0, self.alpha - 0.02); if (self.alpha <= 0) { self.isVisible = false; } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var bg = game.addChild(LK.getAsset('background', { anchorX: 0, anchorY: 0, x: 0, y: 0 })); var fruit = game.addChild(new Fruit()); fruit.x = 600; fruit.y = 2260; var platforms = []; var knives = []; var juiceDrops = []; var gameSpeed = 1; var distanceTraveled = 0; var isGameRunning = true; var finishFruits = []; var finishFruitsSpawned = false; var thoughtBubble = null; var thoughtBubbleShown = false; // UI Elements var scoreTxt = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var distanceTxt = new Text2('Distance: 0m', { size: 50, fill: 0xFFFFFF }); distanceTxt.anchor.set(0, 0); distanceTxt.x = 150; distanceTxt.y = 100; LK.gui.topLeft.addChild(distanceTxt); // Initialize some platforms function createPlatform(x, y) { var platform = new Platform(); platform.x = x; platform.y = y; platforms.push(platform); game.addChild(platform); return platform; } function createKnife(x, y) { var knife = new Knife(); knife.x = x; knife.y = y; knife.lastIntersecting = knife.intersects(fruit); knives.push(knife); game.addChild(knife); return knife; } function createJuiceDrop(x, y) { var drop = new JuiceDrop(); drop.x = x; drop.y = y; drop.lastIntersecting = drop.intersects(fruit); juiceDrops.push(drop); game.addChild(drop); return drop; } function spawnFinishFruits() { // Create fruits with numbers 2, 3, 4, 5 in sequential order side by side var fruitNumbers = [2, 3, 4, 5]; var startX = 2200; var yPosition = 1800; // Same Y position for all fruits to be side by side var platformY = yPosition + 120; // Platform below the fruits for (var i = 0; i < fruitNumbers.length; i++) { var finishFruit = new FinishFruit(); finishFruit.setNumber(fruitNumbers[i]); finishFruit.x = startX + i * 180; // Slightly more spacing for better visibility finishFruit.y = yPosition; finishFruit.lastIntersecting = finishFruit.intersects(fruit); finishFruits.push(finishFruit); game.addChild(finishFruit); // Create platform beneath each finish fruit createPlatform(startX + i * 180, platformY); } } // Create initial platforms createPlatform(600, 2300); createPlatform(900, 2200); createPlatform(1200, 2100); createPlatform(1500, 2000); createPlatform(1800, 1900); // Touch controls game.down = function (x, y, obj) { if (isGameRunning) { fruit.jump(); } }; function checkPlatformCollisions() { for (var i = 0; i < platforms.length; i++) { var platform = platforms[i]; var fruitBottom = fruit.y + 40; var fruitTop = fruit.y - 40; var fruitLeft = fruit.x - 40; var fruitRight = fruit.x + 40; var platformTop = platform.y - 15; var platformBottom = platform.y + 15; var platformLeft = platform.x - 100; var platformRight = platform.x + 100; // Check if fruit is landing on platform from above if (fruit.velocityY > 0 && fruitBottom >= platformTop && fruitTop <= platformBottom && fruitRight >= platformLeft && fruitLeft <= platformRight) { fruit.y = platformTop - 40; fruit.velocityY = 0; fruit.isOnGround = true; fruit.jumpCount = 0; break; } } } function spawnObstacles() { // Spawn platforms if (LK.ticks % Math.max(60, 120 - Math.floor(distanceTraveled / 20)) == 0) { var platformY = 1500 + Math.random() * 800; createPlatform(2200, platformY); } // Spawn knives var knifeSpawnRate = 90; if (LK.ticks % Math.max(knifeSpawnRate, 150 - Math.floor(distanceTraveled / 5)) == 0) { var knifeY = 1400 + Math.random() * 1000; createKnife(2200, knifeY); } // Spawn juice drops on platforms if (LK.ticks % Math.max(120, 180 - Math.floor(distanceTraveled / 8)) == 0) { // Find a platform to spawn juice drop on if (platforms.length > 0) { var randomPlatform = platforms[Math.floor(Math.random() * platforms.length)]; var dropY = randomPlatform.y - 80; // Spawn above the platform createJuiceDrop(randomPlatform.x, dropY); } } } function updateGameSpeed() { gameSpeed = 1 + Math.floor(distanceTraveled / 50) * 0.2; // Update speeds for all moving objects for (var i = 0; i < platforms.length; i++) { platforms[i].speed = -3 * gameSpeed; } for (var i = 0; i < knives.length; i++) { knives[i].speed = -8 * gameSpeed; } for (var i = 0; i < juiceDrops.length; i++) { juiceDrops[i].speed = -4 * gameSpeed; } for (var i = 0; i < finishFruits.length; i++) { finishFruits[i].speed = -3 * gameSpeed; } } game.update = function () { if (!isGameRunning) return; // Update distance distanceTraveled += 0.1 * gameSpeed; distanceTxt.setText('Distance: ' + Math.floor(distanceTraveled) + 'm'); // Update game speed updateGameSpeed(); // Check platform collisions checkPlatformCollisions(); // Spawn new obstacles spawnObstacles(); // Update and clean up platforms for (var i = platforms.length - 1; i >= 0; i--) { var platform = platforms[i]; if (platform.lastX >= -200 && platform.x < -200) { platform.destroy(); platforms.splice(i, 1); } } // Update and clean up knives for (var i = knives.length - 1; i >= 0; i--) { var knife = knives[i]; // Check collision with fruit var currentIntersecting = knife.intersects(fruit); if (!knife.lastIntersecting && currentIntersecting) { // Hit by knife - game over LK.getSound('hit').play(); LK.effects.flashScreen(0xff0000, 1000); isGameRunning = false; LK.showGameOver(); return; } knife.lastIntersecting = currentIntersecting; // Clean up off-screen knives if (knife.lastX >= -200 && knife.x < -200) { knife.destroy(); knives.splice(i, 1); } } // Update and clean up juice drops for (var i = juiceDrops.length - 1; i >= 0; i--) { var drop = juiceDrops[i]; // Check collection var currentIntersecting = drop.intersects(fruit); if (!drop.lastIntersecting && currentIntersecting) { // Collected juice drop LK.setScore(LK.getScore() + 10); scoreTxt.setText('Score: ' + LK.getScore()); LK.getSound('collect').play(); drop.destroy(); juiceDrops.splice(i, 1); continue; } drop.lastIntersecting = currentIntersecting; // Clean up off-screen drops if (drop.lastX >= -200 && drop.x < -200) { drop.destroy(); juiceDrops.splice(i, 1); } } // Update and clean up finish fruits for (var i = finishFruits.length - 1; i >= 0; i--) { var finishFruit = finishFruits[i]; // Check collection var currentIntersecting = finishFruit.intersects(fruit); if (!finishFruit.lastIntersecting && currentIntersecting) { // Collected finish fruit LK.setScore(LK.getScore() + 50); scoreTxt.setText('Score: ' + LK.getScore()); LK.getSound('collect').play(); finishFruit.destroy(); finishFruits.splice(i, 1); continue; } finishFruit.lastIntersecting = currentIntersecting; // Clean up off-screen finish fruits if (finishFruit.lastX >= -200 && finishFruit.x < -200) { finishFruit.destroy(); finishFruits.splice(i, 1); } } // Check win condition - all finish fruits collected if (finishFruitsSpawned && finishFruits.length === 0) { isGameRunning = false; LK.showYouWin(); return; } // Show thought bubble at distance 30 if (distanceTraveled >= 30 && !thoughtBubbleShown) { thoughtBubble = new ThoughtBubble(); thoughtBubble.x = fruit.x; thoughtBubble.y = fruit.y - 150; // Position above the fruit game.addChild(thoughtBubble); thoughtBubbleShown = true; } // Update thought bubble position to follow fruit if (thoughtBubble && thoughtBubble.isVisible) { thoughtBubble.x = fruit.x; thoughtBubble.y = fruit.y - 150; } // Clean up thought bubble when it's no longer visible if (thoughtBubble && !thoughtBubble.isVisible) { thoughtBubble.destroy(); thoughtBubble = null; } // Check win condition at distance 145 if (distanceTraveled >= 145 && !finishFruitsSpawned) { spawnFinishFruits(); finishFruitsSpawned = true; } // Check if fruit fell to ground or off screen if (fruit.y > 2500) { isGameRunning = false; LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } // Add bonus points for distance if (LK.ticks % 60 == 0) { LK.setScore(LK.getScore() + Math.floor(gameSpeed)); scoreTxt.setText('Score: ' + LK.getScore()); } }; // Start background music LK.playMusic('bgmusic');
===================================================================
--- original.js
+++ change.js
@@ -106,8 +106,39 @@
self.x += self.speed;
};
return self;
});
+var ThoughtBubble = Container.expand(function () {
+ var self = Container.call(this);
+ // Create bubble background
+ var bubbleGraphics = self.attachAsset('thoughtBubble', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ bubbleGraphics.alpha = 0.9;
+ // Create text
+ var bubbleText = new Text2('-Kardeşlerimi Bulacağım', {
+ size: 45,
+ fill: 0x000000
+ });
+ bubbleText.anchor.set(0.5, 0.5);
+ self.addChild(bubbleText);
+ // Animation properties
+ self.fadeTimer = 0;
+ self.displayDuration = 180; // 3 seconds at 60fps
+ self.isVisible = true;
+ self.update = function () {
+ self.fadeTimer++;
+ // Fade out after display duration
+ if (self.fadeTimer > self.displayDuration) {
+ self.alpha = Math.max(0, self.alpha - 0.02);
+ if (self.alpha <= 0) {
+ self.isVisible = false;
+ }
+ }
+ };
+ return self;
+});
/****
* Initialize Game
****/
@@ -134,8 +165,10 @@
var distanceTraveled = 0;
var isGameRunning = true;
var finishFruits = [];
var finishFruitsSpawned = false;
+var thoughtBubble = null;
+var thoughtBubbleShown = false;
// UI Elements
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
@@ -352,8 +385,26 @@
isGameRunning = false;
LK.showYouWin();
return;
}
+ // Show thought bubble at distance 30
+ if (distanceTraveled >= 30 && !thoughtBubbleShown) {
+ thoughtBubble = new ThoughtBubble();
+ thoughtBubble.x = fruit.x;
+ thoughtBubble.y = fruit.y - 150; // Position above the fruit
+ game.addChild(thoughtBubble);
+ thoughtBubbleShown = true;
+ }
+ // Update thought bubble position to follow fruit
+ if (thoughtBubble && thoughtBubble.isVisible) {
+ thoughtBubble.x = fruit.x;
+ thoughtBubble.y = fruit.y - 150;
+ }
+ // Clean up thought bubble when it's no longer visible
+ if (thoughtBubble && !thoughtBubble.isVisible) {
+ thoughtBubble.destroy();
+ thoughtBubble = null;
+ }
// Check win condition at distance 145
if (distanceTraveled >= 145 && !finishFruitsSpawned) {
spawnFinishFruits();
finishFruitsSpawned = true;
yürüyen insan portakal. In-Game asset. 2d. High contrast. No shadows
bıçak . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
platform . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
meyve suyu kutu. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
banana human. In-Game asset. 2d. High contrast. No shadows
kiwi human. In-Game asset. 2d. High contrast. No shadows
cucumber human. In-Game asset. 2d. High contrast. No shadows
Mr patates human. In-Game asset. 2d. High contrast. No shadows