User prompt
ana menüdeki pause tuşu kaldırılsın
User prompt
sol yukardaki pause tuşuna basınca çık veya devam et seçenekleri çıksın
User prompt
durdurma tuşuna basınca ana menüye dön veya devam et diye seçenek çıksın
User prompt
müzik açma kapatma tuşu olsun ekranda ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyun önceki haline geri dönsün tam ekranı kaldır
User prompt
oyun sadece tam ekran oynansın
User prompt
oyun tam ekran oynansın
User prompt
kavunda kaldırılsın
User prompt
salatalık oyundan kaldırılsın ve mısırda
User prompt
oyundaki bütün yazılar türkçe olsun
User prompt
oyunun ana menüsünde huzur verici bir müzik çalsın
User prompt
oyuna armut ananas salatalık mısır karpuz kavun ekle
User prompt
skor tablosunu biraz daha uzun göstersin
User prompt
Please fix the bug: 'Error: Invalid value. Only literals or 1-level deep objects/arrays containing literals are allowed.' in or related to this line: 'storage.lastGameResults = transformationResults;' Line Number: 423 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
kivi ekle oyuna
User prompt
2 dakika olsun
User prompt
3 dakika olsun süre
User prompt
5 dakikalık bir süre olsun bu süre içinde kaç tane meyveye dönüştüğünü tabloda göstersin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
meyveler biraz hızlı gelsin
User prompt
bombalar biraz daha hızlı gelsin
User prompt
domatesli arka plan eklensin oyuna
User prompt
oyuna başlarken play veya stop tuşuna basılsın
User prompt
karakter aynı meyveden 5 tane yerse ona dönüşsün
User prompt
karakter biraz hızlı olsun
User prompt
karakter her 5 meyve yediğinde öbür mevyeye dönüşsün
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.attachAsset('bomb', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 7 + Math.random() * 4; self.update = function () { self.y += self.speed; }; return self; }); var Fruit = Container.expand(function (fruitType) { var self = Container.call(this); var fruitGraphics = self.attachAsset(fruitType, { anchorX: 0.5, anchorY: 0.5 }); self.fruitType = fruitType; self.speed = 5 + Math.random() * 3; self.update = function () { self.y += self.speed; }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 12; self.fruitCount = 0; self.currentFruitType = null; self.transformed = false; self.moveLeft = function () { if (self.x > 60) { self.x -= self.speed; } }; self.moveRight = function () { if (self.x < 2048 - 60) { self.x += self.speed; } }; self.collectFruit = function (fruitType) { if (self.currentFruitType === null || self.currentFruitType === fruitType) { self.currentFruitType = fruitType; self.fruitCount++; LK.getSound('collect').play(); if (self.fruitCount >= 5) { self.transform(fruitType); } } else { self.resetProgress(); } updateCounterText(); }; self.resetProgress = function () { self.fruitCount = 0; self.currentFruitType = null; self.transformed = false; // Reset to original player graphics if transformed if (self.transformed) { self.removeChild(playerGraphics); playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); } }; self.transform = function (fruitType) { self.transformed = true; LK.getSound('transform').play(); // Track transformation transformationCount++; transformationResults.push(fruitType + '_' + Math.floor((gameTimeLimit - (gameTimeLimit - gameTimer)) / 60)); // Remove old graphics and add new fruit graphics self.removeChild(playerGraphics); playerGraphics = self.attachAsset(fruitType, { anchorX: 0.5, anchorY: 0.5 }); LK.setScore(LK.getScore() + 100); scoreText.setText('Skor: ' + LK.getScore()); tween(playerGraphics, { scaleX: 1.3, scaleY: 1.3 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { tween(playerGraphics, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.easeIn }); } }); self.resetProgress(); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb }); /**** * Game Code ****/ // Add tomato background var tomatoBackground = game.addChild(LK.getAsset('tomato_bg', { anchorX: 0, anchorY: 0 })); tomatoBackground.x = 0; tomatoBackground.y = 0; var player; var fruits = []; var bombs = []; var gameRunning = false; // Start with game not running var gameStarted = false; // Track if game has started var leftPressed = false; var rightPressed = false; var spawnTimer = 0; var scoreText; var counterText; var playButton; var stopButton; var startMenu; var pauseMenu; var gamePaused = false; var gameTimer = 0; var gameTimeLimit = 120 * 60; // 2 minutes in ticks (60 FPS) var timerText; var transformationCount = 0; var transformationResults = []; // Music control variables var isMusicOn = storage.musicEnabled !== false; // Default to true var musicButton; // Create start menu startMenu = game.addChild(new Container()); // Create play button playButton = startMenu.addChild(LK.getAsset('player', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 })); playButton.x = 2048 / 2 - 200; playButton.y = 2732 / 2; // Add button labels var playText = new Text2('OYNA', { size: 80, fill: 0x00FF00 }); playText.anchor.set(0.5, 0.5); playText.x = playButton.x; playText.y = playButton.y + 150; startMenu.addChild(playText); // Create music toggle button musicButton = startMenu.addChild(LK.getAsset('apple', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2 })); musicButton.x = 2048 / 2; musicButton.y = 2732 / 2 + 200; // Music button label var musicText = new Text2(isMusicOn ? 'MÜZİK AÇIK' : 'MÜZİK KAPALI', { size: 60, fill: isMusicOn ? 0x00FF00 : 0xFF0000 }); musicText.anchor.set(0.5, 0.5); musicText.x = musicButton.x; musicText.y = musicButton.y + 120; startMenu.addChild(musicText); // Create pause menu (hidden initially) pauseMenu = game.addChild(new Container()); pauseMenu.visible = false; // Pause menu background var pauseBg = pauseMenu.addChild(LK.getAsset('player', { anchorX: 0.5, anchorY: 0.5, scaleX: 12, scaleY: 8 })); pauseBg.x = 2048 / 2; pauseBg.y = 2732 / 2; pauseBg.alpha = 0.9; // Continue button var continueButton = pauseMenu.addChild(LK.getAsset('player', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2 })); continueButton.x = 2048 / 2 - 150; continueButton.y = 2732 / 2; // Main menu button var mainMenuButton = pauseMenu.addChild(LK.getAsset('bomb', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2 })); mainMenuButton.x = 2048 / 2 + 150; mainMenuButton.y = 2732 / 2; // Pause menu text var pauseTitleText = new Text2('OYUN DURAKLATILDI', { size: 60, fill: 0xFFFFFF }); pauseTitleText.anchor.set(0.5, 0.5); pauseTitleText.x = 2048 / 2; pauseTitleText.y = 2732 / 2 - 150; pauseMenu.addChild(pauseTitleText); var continueText = new Text2('DEVAM ET', { size: 50, fill: 0x00FF00 }); continueText.anchor.set(0.5, 0.5); continueText.x = continueButton.x; continueText.y = continueButton.y + 100; pauseMenu.addChild(continueText); var mainMenuText = new Text2('ANA MENÜ', { size: 50, fill: 0xFF0000 }); mainMenuText.anchor.set(0.5, 0.5); mainMenuText.x = mainMenuButton.x; mainMenuText.y = mainMenuButton.y + 100; pauseMenu.addChild(mainMenuText); // Initialize player (hidden initially) player = game.addChild(new Player()); player.x = 2048 / 2; player.y = 2732 - 200; player.visible = false; // Initialize UI (hidden initially) scoreText = new Text2('Skor: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0, 0); LK.gui.topLeft.addChild(scoreText); scoreText.x = 120; scoreText.y = 20; scoreText.visible = false; counterText = new Text2('Topla: 0/5', { size: 50, fill: 0xFFFFFF }); counterText.anchor.set(0.5, 0); LK.gui.top.addChild(counterText); counterText.y = 100; counterText.visible = false; timerText = new Text2('Süre: 2:00', { size: 50, fill: 0xFFFF00 }); timerText.anchor.set(1, 0); LK.gui.topRight.addChild(timerText); timerText.x = -20; timerText.y = 20; timerText.visible = false; function updateCounterText() { var fruitName = player.currentFruitType || 'meyveler'; counterText.setText(fruitName + ': ' + player.fruitCount + '/5'); } function toggleMusic() { isMusicOn = !isMusicOn; storage.musicEnabled = isMusicOn; // Update button appearance musicText.setText(isMusicOn ? 'MÜZİK AÇIK' : 'MÜZİK KAPALI'); musicText.fill = isMusicOn ? 0x00FF00 : 0xFF0000; // Control music playback if (isMusicOn) { if (!gameStarted) { LK.playMusic('menuMusic'); } else if (gameRunning && !gamePaused) { LK.playMusic('bgMusic'); } } else { LK.stopMusic(); } } function pauseGame() { gamePaused = true; gameRunning = false; pauseMenu.visible = true; LK.stopMusic(); } function resumeGame() { gamePaused = false; gameRunning = true; pauseMenu.visible = false; if (isMusicOn) { LK.playMusic('bgMusic'); } } function returnToMainMenu() { gamePaused = false; gameRunning = false; gameStarted = false; // Hide pause menu and game elements pauseMenu.visible = false; player.visible = false; scoreText.visible = false; counterText.visible = false; timerText.visible = false; // Show start menu startMenu.visible = true; // Clear game objects for (var i = fruits.length - 1; i >= 0; i--) { fruits[i].destroy(); } fruits = []; for (var j = bombs.length - 1; j >= 0; j--) { bombs[j].destroy(); } bombs = []; // Reset player player.resetProgress(); player.x = 2048 / 2; player.y = 2732 - 200; LK.setScore(0); scoreText.setText('Skor: 0'); updateCounterText(); // Start menu music LK.stopMusic(); if (isMusicOn) { LK.playMusic('menuMusic'); } } function startGame() { gameStarted = true; gameRunning = true; gameTimer = 0; transformationCount = 0; transformationResults = []; // Hide start menu startMenu.visible = false; // Show player player.visible = true; // Stop menu music and start background music LK.stopMusic(); if (isMusicOn) { LK.playMusic('bgMusic'); } // Show UI elements scoreText.visible = true; counterText.visible = true; timerText.visible = true; } // Touch controls for full screen mobile play var touchStartX = null; var touchCurrentX = null; game.down = function (x, y, obj) { if (gamePaused) { // Handle pause menu interactions var continueButtonBounds = { left: 2048 / 2 - 150 - 80, right: 2048 / 2 - 150 + 80, top: 2732 / 2 - 80, bottom: 2732 / 2 + 80 }; var mainMenuButtonBounds = { left: 2048 / 2 + 150 - 80, right: 2048 / 2 + 150 + 80, top: 2732 / 2 - 80, bottom: 2732 / 2 + 80 }; if (x >= continueButtonBounds.left && x <= continueButtonBounds.right && y >= continueButtonBounds.top && y <= continueButtonBounds.bottom) { resumeGame(); } else if (x >= mainMenuButtonBounds.left && x <= mainMenuButtonBounds.right && y >= mainMenuButtonBounds.top && y <= mainMenuButtonBounds.bottom) { returnToMainMenu(); } } else if (!gameStarted) { // Check if play button was clicked var playButtonBounds = { left: playButton.x - 100, right: playButton.x + 100, top: playButton.y - 100, bottom: playButton.y + 100 }; // Check if music button was clicked var musicButtonBounds = { left: musicButton.x - 100, right: musicButton.x + 100, top: musicButton.y - 100, bottom: musicButton.y + 100 }; if (x >= playButtonBounds.left && x <= playButtonBounds.right && y >= playButtonBounds.top && y <= playButtonBounds.bottom) { // Start game startGame(); } else if (x >= musicButtonBounds.left && x <= musicButtonBounds.right && y >= musicButtonBounds.top && y <= musicButtonBounds.bottom) { // Toggle music toggleMusic(); } } else if (gameStarted && gameRunning) { // Check if top-left pause area was touched (avoiding platform menu icon) if (x >= 100 && x <= 200 && y >= 0 && y <= 100) { pauseGame(); } else { // Normal touch controls for gameplay touchStartX = x; touchCurrentX = x; } } }; game.move = function (x, y, obj) { if (gameStarted && gameRunning && !gamePaused) { touchCurrentX = x; // Immediate player positioning for full screen responsiveness if (x < 2048 / 2) { leftPressed = true; rightPressed = false; } else { leftPressed = false; rightPressed = true; } } else if (touchStartX !== null && !gamePaused) { touchCurrentX = x; } }; game.up = function (x, y, obj) { touchStartX = null; touchCurrentX = null; }; function spawnFruit() { var fruitTypes = ['apple', 'orange', 'banana', 'grape', 'kivi', 'armut', 'ananas', 'karpuz']; var randomType = fruitTypes[Math.floor(Math.random() * fruitTypes.length)]; var fruit = new Fruit(randomType); fruit.x = Math.random() * (2048 - 160) + 80; fruit.y = -80; fruits.push(fruit); game.addChild(fruit); } function spawnBomb() { var bomb = new Bomb(); bomb.x = Math.random() * (2048 - 180) + 90; bomb.y = -90; bombs.push(bomb); game.addChild(bomb); } game.update = function () { if (!gameStarted || !gameRunning || gamePaused) return; // Update game timer gameTimer++; var remainingTime = gameTimeLimit - gameTimer; var minutes = Math.floor(remainingTime / (60 * 60)); var seconds = Math.floor(remainingTime % (60 * 60) / 60); timerText.setText('Süre: ' + minutes + ':' + (seconds < 10 ? '0' : '') + seconds); // Check if time is up if (remainingTime <= 0) { gameRunning = false; showTransformationResults(); return; } // Handle touch movement for full screen play if (touchStartX !== null && touchCurrentX !== null) { var deltaX = touchCurrentX - touchStartX; if (deltaX < -30) { player.moveLeft(); } else if (deltaX > 30) { player.moveRight(); } } else { // Direct touch positioning for better full screen control if (touchCurrentX !== null) { if (touchCurrentX < player.x - 50) { player.moveLeft(); } else if (touchCurrentX > player.x + 50) { player.moveRight(); } } } // Spawn objects spawnTimer++; if (spawnTimer % 80 === 0) { spawnFruit(); } if (spawnTimer % 150 === 0) { spawnBomb(); } // Update and check fruits for (var i = fruits.length - 1; i >= 0; i--) { var fruit = fruits[i]; if (fruit.lastY === undefined) fruit.lastY = fruit.y; // Remove off-screen fruits if (fruit.lastY <= 2732 && fruit.y > 2732) { fruit.destroy(); fruits.splice(i, 1); continue; } // Check collision with player if (fruit.intersects(player)) { player.collectFruit(fruit.fruitType); LK.setScore(LK.getScore() + 10); scoreText.setText('Skor: ' + LK.getScore()); fruit.destroy(); fruits.splice(i, 1); continue; } fruit.lastY = fruit.y; } // Update and check bombs for (var j = bombs.length - 1; j >= 0; j--) { var bomb = bombs[j]; if (bomb.lastY === undefined) bomb.lastY = bomb.y; // Remove off-screen bombs if (bomb.lastY <= 2732 && bomb.y > 2732) { bomb.destroy(); bombs.splice(j, 1); continue; } // Check collision with player if (bomb.intersects(player)) { LK.getSound('explode').play(); LK.stopMusic(); if (isMusicOn) { LK.playMusic('sadMusic'); } gameRunning = false; LK.effects.flashScreen(0xff0000, 1000); LK.setTimeout(function () { LK.showGameOver(); }, 1500); bomb.destroy(); bombs.splice(j, 1); continue; } bomb.lastY = bomb.y; } }; function showTransformationResults() { // Store results in persistent storage storage.lastGameTransformations = transformationCount; storage.lastGameResults = transformationResults; // Create results display var resultsContainer = game.addChild(new Container()); // Background var resultsBg = resultsContainer.addChild(LK.getAsset('player', { anchorX: 0.5, anchorY: 0.5, scaleX: 15, scaleY: 15 })); resultsBg.x = 2048 / 2; resultsBg.y = 2732 / 2; resultsBg.alpha = 0.8; // Title var titleText = new Text2('2 Dakika Sonuçları', { size: 80, fill: 0xFFFFFF }); titleText.anchor.set(0.5, 0.5); titleText.x = 2048 / 2; titleText.y = 2732 / 2 - 300; resultsContainer.addChild(titleText); // Total transformations var totalText = new Text2('Toplam Dönüşüm: ' + transformationCount, { size: 60, fill: 0x00FF00 }); totalText.anchor.set(0.5, 0.5); totalText.x = 2048 / 2; totalText.y = 2732 / 2 - 200; resultsContainer.addChild(totalText); // Detailed results var detailsY = 2732 / 2 - 100; for (var i = 0; i < Math.min(transformationResults.length, 15); i++) { var resultData = transformationResults[i].split('_'); var fruitType = resultData[0]; var timeValue = resultData[1]; var detailText = new Text2(i + 1 + '. ' + fruitType + ' - ' + timeValue + 's', { size: 35, fill: 0xFFFFFF }); detailText.anchor.set(0.5, 0.5); detailText.x = 2048 / 2; detailText.y = detailsY + i * 40; resultsContainer.addChild(detailText); } // Show game over after 3 seconds LK.setTimeout(function () { LK.showGameOver(); }, 3000); } // Initialize counter text updateCounterText(); // Start peaceful menu music if (isMusicOn) { LK.playMusic('menuMusic'); }
===================================================================
--- original.js
+++ change.js
@@ -163,17 +163,8 @@
scaleY: 1.5
}));
playButton.x = 2048 / 2 - 200;
playButton.y = 2732 / 2;
-// Create stop button
-stopButton = startMenu.addChild(LK.getAsset('bomb', {
- anchorX: 0.5,
- anchorY: 0.5,
- scaleX: 1.5,
- scaleY: 1.5
-}));
-stopButton.x = 2048 / 2 + 200;
-stopButton.y = 2732 / 2;
// Add button labels
var playText = new Text2('OYNA', {
size: 80,
fill: 0x00FF00
@@ -181,16 +172,8 @@
playText.anchor.set(0.5, 0.5);
playText.x = playButton.x;
playText.y = playButton.y + 150;
startMenu.addChild(playText);
-var stopText = new Text2('DUR', {
- size: 80,
- fill: 0xFF0000
-});
-stopText.anchor.set(0.5, 0.5);
-stopText.x = stopButton.x;
-stopText.y = stopButton.y + 150;
-startMenu.addChild(stopText);
// Create music toggle button
musicButton = startMenu.addChild(LK.getAsset('apple', {
anchorX: 0.5,
anchorY: 0.5,
@@ -415,15 +398,8 @@
right: playButton.x + 100,
top: playButton.y - 100,
bottom: playButton.y + 100
};
- // Check if stop button was clicked
- var stopButtonBounds = {
- left: stopButton.x - 100,
- right: stopButton.x + 100,
- top: stopButton.y - 100,
- bottom: stopButton.y + 100
- };
// Check if music button was clicked
var musicButtonBounds = {
left: musicButton.x - 100,
right: musicButton.x + 100,
@@ -432,15 +408,8 @@
};
if (x >= playButtonBounds.left && x <= playButtonBounds.right && y >= playButtonBounds.top && y <= playButtonBounds.bottom) {
// Start game
startGame();
- } else if (x >= stopButtonBounds.left && x <= stopButtonBounds.right && y >= stopButtonBounds.top && y <= stopButtonBounds.bottom) {
- // Pause game if running, otherwise exit
- if (gameStarted && gameRunning) {
- pauseGame();
- } else {
- LK.showGameOver();
- }
} else if (x >= musicButtonBounds.left && x <= musicButtonBounds.right && y >= musicButtonBounds.top && y <= musicButtonBounds.bottom) {
// Toggle music
toggleMusic();
}
bomba. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Elma. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
muz. In-Game asset. 2d. High contrast. No shadows
portakal. In-Game asset. 2d. High contrast. No shadows
Üzüm. In-Game asset. 2d. High contrast. No shadows
gülen domates. In-Game asset. 2d. High contrast. No shadows
orman büyük olsun. In-Game asset. 2d. High contrast. No shadows
kivi. In-Game asset. 2d. High contrast. No shadows
Ananas. In-Game asset. 2d. High contrast. No shadows
Armut. In-Game asset. 2d. High contrast. No shadows
karpuz. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat