User prompt
fuel yazısı kırımızı renkte olsun
User prompt
biome geçişler çok sert daha yumuşak geçişler olsun
User prompt
fuel bar yakıt kısmı yukardan aşağıya bitsin, ve renkleri daha canlı olsun, biraz belirgin olsun, birde siyah cerçevsi olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
fuel bar sağ üstte al, ve ilk bar yeşil olsun, daha sonra sarı ve kırmızda bitişi olsun
User prompt
fuel benzin kısmını biraz daha güzeleştirmek lazım, sağ tarafa bir fuel bar, ekleyelim
User prompt
arka planı: 0-9999 metre kadar, açık mavı olsun, 10000-19999 kadar mavi, 20000-29000 metreye kadar koyu mavi, 30000-39000 metre kadar koyu gri, 40000-49000 kadar siyah. 50000 den sonra arkaplan sürekli renk değiştirsin. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
remove background image
User prompt
zorluğu arttırmak adına, her 10000 metere bir, assetler, %5 küçülsun. 40000 metereye kadar ve bu döngü devam etsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
roket gözükmüyo şuan ekranda, ekranın zoom alt kısmına yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Update camera zoom pattern to: 0-9999m: 1.25, 10000-19999m: 1.20, 20000-29999m: 1.15, 30000-39999m: 1.10, then repeat
User prompt
Update camera zoom pattern to: 0-9999m: 1.25, 10000-19999m: 1.25, 20000-29999m: 1.15, 30000-39999m: 1.10, then repeat ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Update camera zoom pattern to: 0-9999m: 1.25, 10000-19999m: 1.20, 20000-29999m: 1.15, 30000-39999m: 1.10, then repeat ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Update camera zoom pattern to: 0-9999m: 1.25, 10000-19999m: 1.15, 20000-29999m: 1.5, 30000-39999m: 1.0, then repeat ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
125%, %100, 75%, 50% zoom pattern bu şekilde ayarla ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ilk yakınliık %150 olsun sonra 100% sonra %50 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ekran 10000 kadar, ekran yakınlığı 200% olsun, 20000 de 100% olsun, 30000 %50 olsun 40000 binde terar 200% olsun 50000 de 100% olsun bu döngü böyle devam etsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
fuel yazısını siyah yaz
User prompt
her 10000 metreye ulaşıdığında, ekran küçülsün, yanı ilk etapda büyük ekranda oynasın oyuncu, sonraki etaplarda, zorlaştıramk için engeller, roket ve yakıtlar daha küçük olacak ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
her 10000 metereden sonra arka plan değişsin demiştim, yanı 20000 de 30000 de falan ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
her 10000 metereden sonra, roket yine yavaşlasın, farklı bir arkaplan olsun ve engeller sağ sola kayar olsun, yeni bir biyoma geçiş gibi olsun, yanı level 2 olacak, ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
tam ekran olsun arka plan
User prompt
güzel bir akra plan ekle
User prompt
engellerin width 250px yap
User prompt
Please fix the bug: 'TypeError: LK.assetExists is not a function' in or related to this line: 'if (!LK.assetExists(obsId)) {}' Line Number: 296
User prompt
Please fix the bug: 'TypeError: LK.hasAsset is not a function' in or related to this line: 'if (!LK.hasAsset(obsId)) {}' Line Number: 296
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { best: 0 }); /**** * Classes ****/ // Fuel class var Fuel = Container.expand(function () { var self = Container.call(this); var fuelGfx = self.attachAsset('fuel', { anchorX: 0.5, anchorY: 0.5 }); self.width = fuelGfx.width; self.height = fuelGfx.height; self.update = function () { // Movement handled in game.update }; return self; }); // Obstacle class var Obstacle = Container.expand(function () { var self = Container.call(this); var obsGfx = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); self.width = obsGfx.width; self.height = obsGfx.height; self.update = function () { // Movement handled in game.update }; return self; }); // Rocket class var Rocket = Container.expand(function () { var self = Container.call(this); var rocketGfx = self.attachAsset('rocket', { anchorX: 0.5, anchorY: 0.5 }); self.width = rocketGfx.width; self.height = rocketGfx.height; self.fuel = 100; // percent self.alive = true; self.update = function () { // Nothing here, movement handled in game.update }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // --- Background --- // Biome/level state var currentBiome = 1; var biomeTransitioning = false; var biomeTransitionDistance = 10000; var biome2Background = null; // --- Biome scaling --- // At biome 1: scale = 1.0, biome 2: 0.8, biome 3: 0.65, biome 4: 0.55, biome 5+: 0.45 (minimum) function getBiomeScale(biome) { if (biome <= 1) return 1.0; if (biome === 2) return 0.8; if (biome === 3) return 0.65; if (biome === 4) return 0.55; return 0.45; } var currentBiomeScale = 1.0; // --- Camera zoom logic --- // Zoom pattern: 0-9999m: 1.25, 10000-19999m: 1.15, 20000-29999m: 1.5, 30000-39999m: 1.0, then repeat function getCameraZoom(distance) { var mod = Math.floor(distance / 10000) % 4; if (mod === 0) return 1.25; if (mod === 1) return 1.15; if (mod === 2) return 1.5; return 1.0; } var currentCameraZoom = 2.0; var background = LK.getAsset('backgroundImage', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, scaleX: 2048 / 100, scaleY: 2732 / 100 }); game.addChild(background); // Biome 2 background asset (hidden initially) biome2Background = LK.getAsset('backgroundImage', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, scaleX: 2048 / 100, scaleY: 2732 / 100, tint: 0x4a6cff // blueish tint for biome 2 }); biome2Background.alpha = 0; game.addChild(biome2Background); // Always keep background stretched to full screen on resize game.on('resize', function () { background.x = 2048 / 2; background.y = 2732 / 2; background.scaleX = 2048 / background.width; background.scaleY = 2732 / background.height; }); // Explosion effect (for flash) // Obstacle // Fuel // Rocket (player) // --- Global variables --- var rocket; var fuels = []; var obstacles = []; var dragStartX = null; var dragRocketStartX = null; var isDragging = false; var fuelTimer = 0; var obstacleTimer = 0; var distance = 0; // var best = typeof storage.best === "number" && storage.best > 0 ? storage.best : 0; var fuelDepleteRate = 0.18; // per tick var rocketSpeed = 8; // px per tick (vertical) var fuelSpawnInterval = 90; // ticks var obstacleSpawnInterval = 110; // ticks var minX = 100, maxX = 2048 - 100; var minY = 200, maxY = 2732 - 200; var fuelMax = 100; var fuelAmount = fuelMax * 0.2; // Yakıt toplandığında %20 doldurur var gameStarted = false; // --- UI --- var distanceTxt = new Text2('0 m', { size: 90, fill: 0xFFFFFF }); distanceTxt.anchor.set(0.5, 0); LK.gui.top.addChild(distanceTxt); // Best score UI removed // Fuel bar (simple text) var fuelTxt = new Text2('Yakıt: 100%', { size: 60, fill: 0x000000 }); fuelTxt.anchor.set(0.5, 0); // Place fuelTxt below distanceTxt (metre göstergesinin altında) LK.gui.top.addChild(fuelTxt); fuelTxt.y = distanceTxt.height + 10; // (bestTxt positioning removed) // --- Helper functions --- function resetGame() { // Remove old objects if (rocket) rocket.destroy(); for (var i = 0; i < fuels.length; ++i) fuels[i].destroy(); for (var i = 0; i < obstacles.length; ++i) obstacles[i].destroy(); fuels = []; obstacles = []; // Reset variables distance = 0; fuelTimer = 0; obstacleTimer = 0; currentBiome = 1; biomeTransitioning = false; background.alpha = 1; biome2Background.alpha = 0; // (best score logic removed) // Create rocket rocket = new Rocket(); rocket.x = 2048 / 2; rocket.y = 2732 - 350; rocket.scaleX = currentBiomeScale * currentCameraZoom; rocket.scaleY = currentBiomeScale * currentCameraZoom; if (rocket.children && rocket.children.length > 0) { rocket.children[0].scaleX = currentBiomeScale * currentCameraZoom; rocket.children[0].scaleY = currentBiomeScale * currentCameraZoom; } game.addChild(rocket); rocket.fuel = 100; rocket.alive = true; gameStarted = true; updateUI(); } function updateUI() { distanceTxt.setText(Math.floor(distance) + ' m'); fuelTxt.setText('Fuel: ' + Math.max(0, Math.floor(rocket ? rocket.fuel : 0)) + '%'); } // --- Input (drag to move rocket) --- game.down = function (x, y, obj) { if (!rocket || !rocket.alive) return; isDragging = true; dragStartX = x; dragRocketStartX = rocket.x; }; game.move = function (x, y, obj) { if (!rocket || !rocket.alive) return; if (isDragging) { var dx = x - dragStartX; rocket.x = Math.max(minX, Math.min(maxX, dragRocketStartX + dx)); } }; game.up = function (x, y, obj) { isDragging = false; }; // --- Main game loop --- game.update = function () { if (!rocket || !rocket.alive) return; // --- Camera zoom update --- var newZoom = getCameraZoom(distance); if (Math.abs(currentCameraZoom - newZoom) > 0.01) { // Tween all gameplay elements and backgrounds to new zoom currentCameraZoom = newZoom; // Tween backgrounds tween(background, { scaleX: 2048 / 100 * currentCameraZoom, scaleY: 2732 / 100 * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); tween(biome2Background, { scaleX: 2048 / 100 * currentCameraZoom, scaleY: 2732 / 100 * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); // Tween rocket if (rocket) { tween(rocket, { scaleX: currentBiomeScale * currentCameraZoom, scaleY: currentBiomeScale * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); if (rocket.children && rocket.children.length > 0) { tween(rocket.children[0], { scaleX: currentBiomeScale * currentCameraZoom, scaleY: currentBiomeScale * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); } } // Tween fuels for (var i = 0; i < fuels.length; ++i) { tween(fuels[i], { scaleX: currentBiomeScale * currentCameraZoom, scaleY: currentBiomeScale * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); if (fuels[i].children && fuels[i].children.length > 0) { tween(fuels[i].children[0], { scaleX: currentBiomeScale * currentCameraZoom, scaleY: currentBiomeScale * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); } } // Tween obstacles for (var i = 0; i < obstacles.length; ++i) { tween(obstacles[i], { scaleX: currentBiomeScale * currentCameraZoom, scaleY: currentBiomeScale * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); if (obstacles[i].children && obstacles[i].children.length > 0) { tween(obstacles[i].children[0], { scaleX: currentBiomeScale * currentCameraZoom, scaleY: currentBiomeScale * currentCameraZoom }, { duration: 700, easing: tween.cubicInOut }); } } } // Move rocket up (rocket stays at same y, background moves down) // (Handled by moving all objects up, not down!) // Distance increases as if rocket is moving up distance += rocketSpeed / 6; // scale to meters // Speed up every 200 meters if (!rocket.lastSpeedupDistance) rocket.lastSpeedupDistance = 0; if (Math.floor(distance / 200) > Math.floor(rocket.lastSpeedupDistance / 200)) { rocketSpeed += 1.5; rocket.lastSpeedupDistance = distance; } // --- Biome/level transition every 10000m --- if (!biomeTransitioning && Math.floor(distance / biomeTransitionDistance) + 1 !== currentBiome) { biomeTransitioning = true; var nextBiome = Math.floor(distance / biomeTransitionDistance) + 1; // Slow rocket var oldSpeed = rocketSpeed; tween({ v: oldSpeed }, { v: 6 }, { duration: 1200, easing: tween.cubicOut, onUpdate: function onUpdate(obj) { rocketSpeed = obj.v; }, onFinish: function onFinish() { rocketSpeed = 6; currentBiome = nextBiome; biomeTransitioning = false; // --- Scale down rocket, fuels, and obstacles for new biome --- var newScale = getBiomeScale(currentBiome); if (Math.abs(currentBiomeScale - newScale) > 0.01) { currentBiomeScale = newScale; // Tween rocket scale if (rocket) { tween(rocket, { scaleX: newScale, scaleY: newScale }, { duration: 600, easing: tween.cubicInOut }); // Also scale attached asset if needed if (rocket.children && rocket.children.length > 0) { tween(rocket.children[0], { scaleX: newScale, scaleY: newScale }, { duration: 600, easing: tween.cubicInOut }); } } // Tween all fuels for (var i = 0; i < fuels.length; ++i) { tween(fuels[i], { scaleX: newScale, scaleY: newScale }, { duration: 600, easing: tween.cubicInOut }); if (fuels[i].children && fuels[i].children.length > 0) { tween(fuels[i].children[0], { scaleX: newScale, scaleY: newScale }, { duration: 600, easing: tween.cubicInOut }); } } // Tween all obstacles for (var i = 0; i < obstacles.length; ++i) { tween(obstacles[i], { scaleX: newScale, scaleY: newScale }, { duration: 600, easing: tween.cubicInOut }); if (obstacles[i].children && obstacles[i].children.length > 0) { tween(obstacles[i].children[0], { scaleX: newScale, scaleY: newScale }, { duration: 600, easing: tween.cubicInOut }); } } } } }); // Fade backgrounds if (currentBiome % 2 === 1) { // Odd biome: fade out background, fade in biome2Background tween(background, { alpha: 0 }, { duration: 900, easing: tween.cubicInOut }); tween(biome2Background, { alpha: 1 }, { duration: 900, easing: tween.cubicInOut }); } else { // Even biome: fade in background, fade out biome2Background tween(background, { alpha: 1 }, { duration: 900, easing: tween.cubicInOut }); tween(biome2Background, { alpha: 0 }, { duration: 900, easing: tween.cubicInOut }); } } updateUI(); // Deplete fuel rocket.fuel -= fuelDepleteRate; if (rocket.fuel <= 0) { rocket.fuel = 0; rocket.alive = false; LK.effects.flashScreen(0xff0000, 800); LK.showGameOver(); return; } // Move fuels and check collision for (var i = fuels.length - 1; i >= 0; --i) { var f = fuels[i]; f.y += rocketSpeed; // move up relative to rocket (background moves down) if (f.y > maxY + 200) { f.destroy(); fuels.splice(i, 1); continue; } if (rocket.intersects(f)) { rocket.fuel = Math.min(fuelMax, rocket.fuel + fuelAmount); f.destroy(); fuels.splice(i, 1); // Small flash effect LK.effects.flashObject(rocket, 0x44ddee, 300); updateUI(); } } // Move obstacles and check collision for (var i = obstacles.length - 1; i >= 0; --i) { var o = obstacles[i]; o.y += rocketSpeed; // move up relative to rocket (background moves down) // --- Biome 2: obstacles move horizontally --- if (currentBiome === 2) { if (typeof o.biome2Dir === "undefined") { o.biome2Dir = Math.random() < 0.5 ? -1 : 1; o.biome2Speed = 3 + Math.random() * 2; } o.x += o.biome2Dir * o.biome2Speed; // Bounce at screen edges if (o.x < minX + o.width / 2) { o.x = minX + o.width / 2; o.biome2Dir *= -1; } if (o.x > maxX - o.width / 2) { o.x = maxX - o.width / 2; o.biome2Dir *= -1; } } if (o.y > maxY + 200) { o.destroy(); obstacles.splice(i, 1); continue; } if (rocket.intersects(o)) { // Only lose 10% fuel, don't die instantly var lostFuel = fuelMax * 0.10; rocket.fuel = Math.max(0, rocket.fuel - lostFuel); LK.effects.flashObject(rocket, 0xff4444, 400); // --- Rocket collision animation: shake horizontally --- // Stop any previous tweens on rocket.x tween.stop(rocket, { x: true }); var originalX = rocket.x; // Animate shake: left, right, center tween(rocket, { x: originalX - 40 }, { duration: 60, easing: tween.cubicOut, onFinish: function onFinish() { tween(rocket, { x: originalX + 40 }, { duration: 90, easing: tween.cubicInOut, onFinish: function onFinish() { tween(rocket, { x: originalX }, { duration: 70, easing: tween.cubicIn }); } }); } }); // --- End rocket collision animation --- obstacles.splice(i, 1); o.destroy(); updateUI(); // If fuel is now 0, trigger game over as normal if (rocket.fuel <= 0) { rocket.fuel = 0; rocket.alive = false; LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } continue; } } // Spawn fuel fuelTimer++; if (fuelTimer >= fuelSpawnInterval) { fuelTimer = 0; var f = new Fuel(); f.x = Math.floor(minX + Math.random() * (maxX - minX)); // Spawn above the visible screen, so they fall into view from the top f.y = rocket.y - 2732 / 2 - 200 - Math.random() * 300; f.scaleX = currentBiomeScale * currentCameraZoom; f.scaleY = currentBiomeScale * currentCameraZoom; if (f.children && f.children.length > 0) { f.children[0].scaleX = currentBiomeScale * currentCameraZoom; f.children[0].scaleY = currentBiomeScale * currentCameraZoom; } game.addChild(f); fuels.push(f); } // Spawn obstacle obstacleTimer++; if (obstacleTimer >= obstacleSpawnInterval) { obstacleTimer = 0; var o = new Obstacle(); o.x = Math.floor(minX + Math.random() * (maxX - minX)); // Spawn above the visible screen, so they fall into view from the top o.y = rocket.y - 2732 / 2 - 400 - Math.random() * 400; o.scaleX = currentBiomeScale * currentCameraZoom; o.scaleY = currentBiomeScale * currentCameraZoom; if (o.children && o.children.length > 0) { o.children[0].scaleX = currentBiomeScale * currentCameraZoom; o.children[0].scaleY = currentBiomeScale * currentCameraZoom; } game.addChild(o); obstacles.push(o); } }; // --- Game over / win handling --- LK.on('gameover', function () { gameStarted = false; updateUI(); // (best score display removed) LK.setTimeout(function () { resetGame(); }, 1200); }); // --- Start game --- resetGame();
===================================================================
--- original.js
+++ change.js
@@ -80,15 +80,15 @@
return 0.45;
}
var currentBiomeScale = 1.0;
// --- Camera zoom logic ---
-// Zoom pattern: 0-9999m: 1.25, 10000-19999m: 1.0, 20000-29999m: 0.75, 30000-39999m: 0.5, then repeat
+// Zoom pattern: 0-9999m: 1.25, 10000-19999m: 1.15, 20000-29999m: 1.5, 30000-39999m: 1.0, then repeat
function getCameraZoom(distance) {
var mod = Math.floor(distance / 10000) % 4;
if (mod === 0) return 1.25;
- if (mod === 1) return 1.0;
- if (mod === 2) return 0.75;
- return 0.5;
+ if (mod === 1) return 1.15;
+ if (mod === 2) return 1.5;
+ return 1.0;
}
var currentCameraZoom = 2.0;
var background = LK.getAsset('backgroundImage', {
anchorX: 0.5,