User prompt
kuş rastgele bir şekilde aşağı ve yukarı olmak üzere düz ve sola doğru gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyun akışı biraz hızlansın
User prompt
kuş karaktere doğru yani sola doğru gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bide havada uşan kuş yap değdiğimizde 1 can gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyu başlama arka planına resim koy
User prompt
ve öldüğünde 1. levele tekrar geri dönsün ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
platforma uzun bir tahta yap ince olsun
User prompt
her level geçişinde kapı olsun ve kapının yanında bir şeyler olmasın
User prompt
hayır bak 200 altın toplandığında üstüne eklesin yani 400 + 600 şeklinde her level için 200 coın gerekir bu yüzden her 200 altın toplandığı zaman yani coıne 200 eklendiği zaman levele gecilsin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
her 200 altın toplandığında ekrana level sayısını belirtsin
User prompt
kapı olduğu zaman yanlarında altın vb şeyler olmasın ve level atladıkca ekrana 2. LEVEL diye yazsın ve bu 3. level , 4. level diye full gitsin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
ve oyunda 200 puan toplandığında oyun sonunda bir kapı belirsin ve diğer levele geçsin , level 2 ,level 3 diye devam etsin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
tahtalardada yürüyebilsin ve tahtalar biraz daha uzun olsun
User prompt
ve üstüne çıkmak için de tahta koy ince tahtalar koy ve onların üstünde sadece altın olsun ama çok koyma ve tahtalar uzun olsun ve ince olsun ve rastgele ( random) sağa sola veya yukarıya yerleştirilsin
User prompt
arka plana resim koy mavi renge
User prompt
zıplamayı biraz daha arttır
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'x')' in or related to this line: 'coin.x = spawnX + Math.random() * 100 + 50; // Add spacing variation' Line Number: 204
User prompt
bazı öğeleri yanyana koyma bombaların arasında veyaz dikenlerin arasında biraz boşluk olsun
User prompt
zıplama seviyesini arttır biraz
User prompt
canlar sağ üstte gözüksün kalp şeklinde ver 5 can olsun
Code edit (1 edits merged)
Please save this source code
User prompt
Mario's Endless Adventure
Initial prompt
make me a game like mario he will advance in an endless place collecting gold and when he touches some bombs his health will decrease and his health will be shown as a heart on the top right and the game will be level by level and there will be thorny roads in some places his health will decrease when he touches them but the thorns will not be too frequent and when he runs out of health the game score will appear on the screen and it will say try again, the game will say play on the start screen and there will be a gray background, in the game the ground will be green and the air will be blue
/**** * 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: 1.0 }); self.hasHit = false; self.update = function () { self.x -= gameSpeed; if (!self.hasHit && self.intersects(mario)) { self.hasHit = true; takeDamage(); } }; return self; }); var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.update = function () { self.x -= gameSpeed; if (!self.collected && self.intersects(mario)) { self.collected = true; LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); LK.getSound('coin').play(); self.alpha = 0; // Check if we collected exactly 200 coins (or multiples of 200) if (LK.getScore() % 200 === 0 && LK.getScore() > 0) { spawnDoor(); } } }; return self; }); var Door = Container.expand(function () { var self = Container.call(this); var doorGraphics = self.attachAsset('door', { anchorX: 0.5, anchorY: 1.0 }); self.hasEntered = false; self.update = function () { self.x -= gameSpeed; if (!self.hasEntered && self.intersects(mario)) { self.hasEntered = true; nextLevel(); } }; return self; }); var Ground = Container.expand(function () { var self = Container.call(this); var groundGraphics = self.attachAsset('ground', { anchorX: 0, anchorY: 0 }); self.update = function () { self.x -= gameSpeed; }; return self; }); var Mario = Container.expand(function () { var self = Container.call(this); var marioGraphics = self.attachAsset('mario', { anchorX: 0.5, anchorY: 1.0 }); self.velocityY = 0; self.gravity = 0.8; self.jumpPower = -30; self.isOnGround = false; self.isJumping = false; self.jump = function () { if (self.isOnGround && !self.isJumping) { self.velocityY = self.jumpPower; self.isOnGround = false; self.isJumping = true; LK.getSound('jump').play(); } }; self.update = function () { self.velocityY += self.gravity; self.y += self.velocityY; // Check platform collisions var onPlatform = false; for (var i = 0; i < platforms.length; i++) { var platform = platforms[i]; // Better platform collision - check if Mario is above platform and falling down var marioBottom = self.y; var platformTop = platform.y - 10; var platformLeft = platform.x - 300; // Half of platform width (600/2) var platformRight = platform.x + 300; // Half of platform width (600/2) if (self.velocityY >= 0 && marioBottom >= platformTop - 20 && marioBottom <= platformTop + 20 && self.x >= platformLeft && self.x <= platformRight) { self.y = platformTop; self.velocityY = 0; self.isOnGround = true; self.isJumping = false; onPlatform = true; break; } } // Check ground collision if (!onPlatform && self.y >= groundY) { self.y = groundY; self.velocityY = 0; self.isOnGround = true; self.isJumping = false; } }; return self; }); var Platform = Container.expand(function () { var self = Container.call(this); var platformGraphics = self.attachAsset('platform', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { self.x -= gameSpeed; }; return self; }); var Thorn = Container.expand(function () { var self = Container.call(this); var thornGraphics = self.attachAsset('thorn', { anchorX: 0.5, anchorY: 1.0 }); self.hasHit = false; self.update = function () { self.x -= gameSpeed; if (!self.hasHit && self.intersects(mario)) { self.hasHit = true; takeDamage(); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb }); /**** * Game Code ****/ var mario; var groundTiles = []; var coins = []; var bombs = []; var thorns = []; var platforms = []; var hearts = []; var doors = []; var gameSpeed = 6; var groundY = 2400; var maxHealth = 5; var currentHealth = maxHealth; var spawnTimer = 0; var gameStarted = false; var currentLevel = storage.currentLevel || 1; var doorSpawned = false; var levelTxt = new Text2('Level ' + currentLevel, { size: 60, fill: 0xFFFFFF }); levelTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(levelTxt); levelTxt.x = 120; // Avoid the platform menu icon levelTxt.y = 20; var scoreTxt = new Text2('0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var startButton = new Text2('PLAY', { size: 120, fill: 0xFFFFFF }); startButton.anchor.set(0.5, 0.5); LK.gui.center.addChild(startButton); // Add background image to start screen immediately var background = game.addChild(LK.getAsset('background', { anchorX: 0, anchorY: 0 })); background.x = 0; background.y = 0; function initializeGame() { game.setBackgroundColor(0x87ceeb); mario = game.addChild(new Mario()); mario.x = 300; mario.y = groundY; for (var i = 0; i < 15; i++) { var ground = game.addChild(new Ground()); ground.x = i * 200; ground.y = groundY; groundTiles.push(ground); } createHearts(); gameStarted = true; startButton.visible = false; gameSpeed = 6 + (currentLevel - 1) * 2; // Adjust speed based on level levelTxt.setText('Level ' + currentLevel); game.setBackgroundColor(0x87ceeb); } function createHearts() { for (var i = 0; i < maxHealth; i++) { var heart = LK.getAsset('heart', { anchorX: 0.5, anchorY: 0.5 }); heart.x = LK.gui.topRight.x - 60 - i * 45; heart.y = 60; hearts.push(heart); LK.gui.topRight.addChild(heart); } } function updateHearts() { for (var i = 0; i < hearts.length; i++) { hearts[i].alpha = i < currentHealth ? 1.0 : 0.3; } } function takeDamage() { if (currentHealth > 0) { currentHealth--; updateHearts(); LK.getSound('hurt').play(); LK.effects.flashScreen(0xff0000, 300); if (currentHealth <= 0) { // Reset to level 1 when player dies currentLevel = 1; storage.currentLevel = currentLevel; levelTxt.setText('Level ' + currentLevel); LK.showGameOver(); } } } function nextLevel() { currentLevel++; storage.currentLevel = currentLevel; levelTxt.setText('Level ' + currentLevel); // Show level announcement showLevelAnnouncement(); // Increase speed each level gameSpeed = 6 + (currentLevel - 1) * 2; // Clear obstacles but keep coins and score for (var i = 0; i < doors.length; i++) { doors[i].destroy(); } doors = []; doorSpawned = false; for (var i = 0; i < bombs.length; i++) { bombs[i].destroy(); } bombs = []; for (var i = 0; i < thorns.length; i++) { thorns[i].destroy(); } thorns = []; for (var i = 0; i < platforms.length; i++) { platforms[i].destroy(); } platforms = []; // Reset Mario position but keep coins mario.x = 300; mario.y = groundY; mario.velocityY = 0; mario.isOnGround = true; mario.isJumping = false; } function spawnDoor() { if (!doorSpawned) { var door = game.addChild(new Door()); door.x = 2400; // Spawn further away to give player time door.y = groundY; doors.push(door); doorSpawned = true; } } function spawnObstacle() { // Don't spawn obstacles if door is active if (doorSpawned) { return; } var rand = Math.random(); var spawnX = 2200; if (rand < 0.25) { var coin = game.addChild(new Coin()); coin.x = spawnX; coin.y = groundY - 100 - Math.random() * 150; coins.push(coin); } else if (rand < 0.45) { var bomb = game.addChild(new Bomb()); bomb.x = spawnX + Math.random() * 100 + 50; // Add spacing variation bomb.y = groundY; bombs.push(bomb); } else if (rand < 0.65) { var thorn = game.addChild(new Thorn()); thorn.x = spawnX + Math.random() * 100 + 50; // Add spacing variation thorn.y = groundY; thorns.push(thorn); } else if (rand < 0.85) { // Spawn platform with coins on top var platform = game.addChild(new Platform()); platform.x = spawnX + Math.random() * 200 + 100; // Random horizontal position platform.y = groundY - 200 - Math.random() * 300; // Random height platforms.push(platform); // Add 4-6 coins on the platform (spread across the long plank) var numCoins = 4 + Math.floor(Math.random() * 3); for (var i = 0; i < numCoins; i++) { var coin = game.addChild(new Coin()); coin.x = platform.x - 280 + i * 140; // Spread coins across the 600px wide plank coin.y = platform.y - 60; coins.push(coin); } } } function cleanupObjects() { for (var i = coins.length - 1; i >= 0; i--) { if (coins[i].x < -100) { coins[i].destroy(); coins.splice(i, 1); } } for (var i = bombs.length - 1; i >= 0; i--) { if (bombs[i].x < -100) { bombs[i].destroy(); bombs.splice(i, 1); } } for (var i = thorns.length - 1; i >= 0; i--) { if (thorns[i].x < -100) { thorns[i].destroy(); thorns.splice(i, 1); } } for (var i = platforms.length - 1; i >= 0; i--) { if (platforms[i].x < -500) { platforms[i].destroy(); platforms.splice(i, 1); } } for (var i = doors.length - 1; i >= 0; i--) { if (doors[i].x < -100) { doors[i].destroy(); doors.splice(i, 1); } } for (var i = groundTiles.length - 1; i >= 0; i--) { if (groundTiles[i].x < -400) { var ground = game.addChild(new Ground()); ground.x = groundTiles[groundTiles.length - 1].x + 200; ground.y = groundY; groundTiles.push(ground); groundTiles[i].destroy(); groundTiles.splice(i, 1); } } } game.down = function (x, y, obj) { if (!gameStarted) { initializeGame(); } else { mario.jump(); } }; startButton.down = function (x, y, obj) { initializeGame(); }; var levelAnnouncementTxt = null; var levelAnnouncementTimer = 0; function showLevelAnnouncement() { if (levelAnnouncementTxt) { LK.gui.center.removeChild(levelAnnouncementTxt); } levelAnnouncementTxt = new Text2(currentLevel + '. LEVEL', { size: 120, fill: 0xFFD700 }); levelAnnouncementTxt.anchor.set(0.5, 0.5); LK.gui.center.addChild(levelAnnouncementTxt); levelAnnouncementTimer = 120; // Show for 2 seconds at 60fps } game.update = function () { if (!gameStarted) { return; } // Handle level announcement display if (levelAnnouncementTimer > 0) { levelAnnouncementTimer--; if (levelAnnouncementTimer <= 0 && levelAnnouncementTxt) { LK.gui.center.removeChild(levelAnnouncementTxt); levelAnnouncementTxt = null; } return; // Don't spawn obstacles while showing level announcement } spawnTimer++; if (spawnTimer >= 90) { // Increased from 60 to 90 for more spacing spawnObstacle(); spawnTimer = 0; } cleanupObjects(); gameSpeed += 0.001; };
===================================================================
--- original.js
+++ change.js
@@ -196,16 +196,17 @@
fill: 0xFFFFFF
});
startButton.anchor.set(0.5, 0.5);
LK.gui.center.addChild(startButton);
+// Add background image to start screen immediately
+var background = game.addChild(LK.getAsset('background', {
+ anchorX: 0,
+ anchorY: 0
+}));
+background.x = 0;
+background.y = 0;
function initializeGame() {
game.setBackgroundColor(0x87ceeb);
- var background = game.addChild(LK.getAsset('background', {
- anchorX: 0,
- anchorY: 0
- }));
- background.x = 0;
- background.y = 0;
mario = game.addChild(new Mario());
mario.x = 300;
mario.y = groundY;
for (var i = 0; i < 15; i++) {
ince bir çimenli zemin. In-Game asset. 2d. High contrast. No shadows
bomb. In-Game asset. 2d. High contrast. No shadows
altın para. In-Game asset. 2d. High contrast. No shadows
dikenler. In-Game asset. 2d. High contrast. No shadows
bulutlu bir hava. In-Game asset. 2d. High contrast. No shadows
portal. In-Game asset. 2d. High contrast. No shadows
sinirli bir uçan kuş. In-Game asset. 2d. High contrast. No shadows
red heart. In-Game asset. 2d. High contrast. No shadows