User prompt
Belirli platformların üstünde altın olsun onların hepsini toplayamazsak goalden geçemeyelim geçmeye calışırsak uyarı yazısı olarak şu yazsın önce tüm altınları topla yazsın
User prompt
Zıplama tuşu heroyu çk yukarı çıkarsin
User prompt
Zıplama tuşu heroyu daha çok yukarı çıkarsin ve yön tuşlarıyla aynı hizzada olsun
User prompt
Zıplama tuşu daha yukarıya çıkarsin
User prompt
Zıplama tuşu çok yükseğe çıkarsın ve yön tuşlarıyla aynı hizzada olsun
User prompt
Zıplama tuşu bir tıkda yukarıda olsun ama çok az
User prompt
Yön tuşlarını düzgün yerleştir
User prompt
Tön tuşunu oyunun en altına yerleştir ama oyunda gözüksün
User prompt
Yön tuşları çok yukarda olmuş biraz aşşağı indir
User prompt
Yön tuşlarını üste yerleştir gözükmüyo
User prompt
Oyuna yön tuşları ekle sağa ve sola ve zıplama tuşuda ekle dokunduğumuzu yap
Code edit (1 edits merged)
Please save this source code
User prompt
Adventure Quest: Hero's Journey
Initial prompt
Bir macera oyunu olsun ana karakterimiz olsun diyelim onunla düşmanlarla savaşıp parkurları geçmeye çalışalım
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.velocity = { x: 0, y: 0 }; self.lifetime = 120; self.update = function () { self.x += self.velocity.x; self.y += self.velocity.y; self.lifetime--; if (self.lifetime <= 0 || self.x > 2100 || self.x < -50) { self.destroy(); for (var i = bullets.length - 1; i >= 0; i--) { if (bullets[i] === self) { bullets.splice(i, 1); break; } } } }; return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 1 }); self.velocity = { x: -2, y: 0 }; self.health = 1; self.patrolDistance = 150; self.startX = 0; self.onGround = false; self.update = function () { // Apply gravity if (!self.onGround) { self.velocity.y += 1.2; } // Simple patrol movement if (Math.abs(self.x - self.startX) > self.patrolDistance) { self.velocity.x *= -1; } // Apply velocity self.x += self.velocity.x; self.y += self.velocity.y; // Remove if fallen off screen if (self.y > 2800) { self.destroy(); for (var i = enemies.length - 1; i >= 0; i--) { if (enemies[i] === self) { enemies.splice(i, 1); break; } } } }; self.takeDamage = function () { self.health--; if (self.health <= 0) { LK.effects.flashObject(self, 0xffffff, 300); LK.getSound('enemyDeath').play(); LK.setScore(LK.getScore() + 10); scoreText.setText(LK.getScore()); self.destroy(); for (var i = enemies.length - 1; i >= 0; i--) { if (enemies[i] === self) { enemies.splice(i, 1); break; } } } }; return self; }); var Goal = Container.expand(function () { var self = Container.call(this); var goalGraphics = self.attachAsset('goal', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { goalGraphics.rotation += 0.05; }; return self; }); var Hero = Container.expand(function () { var self = Container.call(this); var heroGraphics = self.attachAsset('hero', { anchorX: 0.5, anchorY: 1 }); self.velocity = { x: 0, y: 0 }; self.onGround = false; self.health = 3; self.maxHealth = 3; self.moveSpeed = 8; self.jumpPower = -8; self.canAttack = true; self.attackCooldown = 0; self.update = function () { // Apply gravity if (!self.onGround) { self.velocity.y += 1.2; } // Apply velocity self.x += self.velocity.x; self.y += self.velocity.y; // Handle attack cooldown if (self.attackCooldown > 0) { self.attackCooldown--; if (self.attackCooldown === 0) { self.canAttack = true; } } // Keep hero in bounds if (self.x < 40) self.x = 40; if (self.x > 2008) self.x = 2008; // Check if fallen off screen if (self.y > 2800) { self.takeDamage(1); self.respawn(); } }; self.jump = function () { if (self.onGround) { self.velocity.y = self.jumpPower; self.onGround = false; LK.getSound('jump').play(); } }; self.attack = function () { if (self.canAttack) { var bullet = new Bullet(); bullet.x = self.x; bullet.y = self.y - 40; bullet.velocity.x = 12; bullets.push(bullet); game.addChild(bullet); self.canAttack = false; self.attackCooldown = 20; LK.getSound('attack').play(); } }; self.takeDamage = function (damage) { self.health -= damage; LK.effects.flashObject(self, 0xff0000, 500); LK.getSound('hit').play(); if (self.health <= 0) { LK.showGameOver(); } updateHealthDisplay(); }; self.respawn = function () { self.x = spawnPoint.x; self.y = spawnPoint.y; self.velocity.x = 0; self.velocity.y = 0; }; return self; }); var Platform = Container.expand(function () { var self = Container.call(this); var platformGraphics = self.attachAsset('platform', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Spike = Container.expand(function () { var self = Container.call(this); var spikeGraphics = self.attachAsset('spike', { anchorX: 0.5, anchorY: 1 }); return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb }); /**** * Game Code ****/ var hero; var enemies = []; var platforms = []; var spikes = []; var bullets = []; var goal; var spawnPoint = { x: 200, y: 2400 }; var currentLevel = 1; var leftPressed = false; var rightPressed = false; // UI Elements var scoreText = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0, 0); LK.gui.topRight.addChild(scoreText); var healthText = new Text2('Health: 3/3', { size: 60, fill: 0xFFFFFF }); healthText.anchor.set(0, 0); healthText.x = -300; LK.gui.topRight.addChild(healthText); var levelText = new Text2('Level 1', { size: 80, fill: 0xFFFFFF }); levelText.anchor.set(0.5, 0); LK.gui.top.addChild(levelText); // Control buttons var leftButton = new Text2('◀', { size: 120, fill: 0xFFFFFF }); leftButton.anchor.set(0.5, 0.5); leftButton.alpha = 0.7; leftButton.x = 150; leftButton.y = -150; LK.gui.bottomLeft.addChild(leftButton); var rightButton = new Text2('▶', { size: 120, fill: 0xFFFFFF }); rightButton.anchor.set(0.5, 0.5); rightButton.x = 300; rightButton.y = -150; LK.gui.bottomLeft.addChild(rightButton); var jumpButton = new Text2('▲', { size: 120, fill: 0xFFFFFF }); jumpButton.anchor.set(0.5, 0.5); jumpButton.alpha = 0.7; LK.gui.bottom.addChild(jumpButton); function updateHealthDisplay() { healthText.setText('Health: ' + hero.health + '/' + hero.maxHealth); } function createLevel1() { // Ground platforms createPlatform(200, 2500); createPlatform(600, 2400); createPlatform(1000, 2300); createPlatform(1400, 2200); createPlatform(1800, 2100); // Some floating platforms createPlatform(400, 2200); createPlatform(800, 2000); createPlatform(1200, 1800); // Spikes createSpike(500, 2500); createSpike(900, 2300); createSpike(1300, 2200); // Enemies createEnemy(700, 2360); createEnemy(1100, 2260); createEnemy(1500, 2160); // Goal goal = new Goal(); goal.x = 1800; goal.y = 2000; game.addChild(goal); } function createPlatform(x, y) { var platform = new Platform(); platform.x = x; platform.y = y; platforms.push(platform); game.addChild(platform); } function createSpike(x, y) { var spike = new Spike(); spike.x = x; spike.y = y; spikes.push(spike); game.addChild(spike); } function createEnemy(x, y) { var enemy = new Enemy(); enemy.x = x; enemy.y = y; enemy.startX = x; enemies.push(enemy); game.addChild(enemy); } function checkPlatformCollisions(obj) { obj.onGround = false; for (var i = 0; i < platforms.length; i++) { var platform = platforms[i]; if (obj.intersects(platform)) { var objBottom = obj.y; var objTop = obj.y - 80; var objLeft = obj.x - 40; var objRight = obj.x + 40; var platformTop = platform.y - 20; var platformBottom = platform.y + 20; var platformLeft = platform.x - 100; var platformRight = platform.x + 100; // Landing on top if (obj.velocity.y > 0 && objBottom > platformTop && objTop < platformTop) { obj.y = platformTop; obj.velocity.y = 0; obj.onGround = true; } // Hitting from below else if (obj.velocity.y < 0 && objTop < platformBottom && objBottom > platformBottom) { obj.y = platformBottom + 80; obj.velocity.y = 0; } // Hitting from left else if (obj.velocity.x > 0 && objRight > platformLeft && objLeft < platformLeft) { obj.x = platformLeft - 40; obj.velocity.x = 0; } // Hitting from right else if (obj.velocity.x < 0 && objLeft < platformRight && objRight > platformRight) { obj.x = platformRight + 40; obj.velocity.x = 0; } } } } function nextLevel() { currentLevel++; levelText.setText('Level ' + currentLevel); // Clear current level for (var i = 0; i < enemies.length; i++) { enemies[i].destroy(); } enemies = []; for (var j = 0; j < platforms.length; j++) { platforms[j].destroy(); } platforms = []; for (var k = 0; k < spikes.length; k++) { spikes[k].destroy(); } spikes = []; if (goal) { goal.destroy(); } // Create new level (simple progression) createLevel1(); // For now, recreate same level with more difficulty // Reset hero position hero.x = spawnPoint.x; hero.y = spawnPoint.y; hero.velocity.x = 0; hero.velocity.y = 0; } // Initialize hero hero = new Hero(); hero.x = spawnPoint.x; hero.y = spawnPoint.y; game.addChild(hero); // Create first level createLevel1(); updateHealthDisplay(); // Input handling leftButton.down = function (x, y, obj) { leftPressed = true; leftButton.alpha = 1.0; }; leftButton.up = function (x, y, obj) { leftPressed = false; leftButton.alpha = 0.7; }; rightButton.down = function (x, y, obj) { rightPressed = true; rightButton.alpha = 1.0; }; rightButton.up = function (x, y, obj) { rightPressed = false; rightButton.alpha = 0.7; }; jumpButton.down = function (x, y, obj) { hero.jump(); jumpButton.alpha = 1.0; }; jumpButton.up = function (x, y, obj) { jumpButton.alpha = 0.7; }; // Keep attack functionality on main game area game.down = function (x, y, obj) { // Only handle attack when touching the main game area (not buttons) var gameLocalPos = game.toLocal({ x: x, y: y }); if (gameLocalPos.x > 300 && gameLocalPos.x < 1748 && gameLocalPos.y < 2000) { hero.attack(); } }; game.update = function () { // Handle hero movement input hero.velocity.x = 0; if (leftPressed) { hero.velocity.x = -hero.moveSpeed; } if (rightPressed) { hero.velocity.x = hero.moveSpeed; } // Check platform collisions for hero checkPlatformCollisions(hero); // Check platform collisions for enemies for (var i = 0; i < enemies.length; i++) { checkPlatformCollisions(enemies[i]); } // Check hero-enemy collisions for (var j = 0; j < enemies.length; j++) { var enemy = enemies[j]; if (hero.intersects(enemy)) { if (!hero.lastEnemyCollision || hero.lastEnemyCollision !== enemy) { hero.takeDamage(1); hero.lastEnemyCollision = enemy; // Knockback if (hero.x < enemy.x) { hero.velocity.x = -15; } else { hero.velocity.x = 15; } } } } // Reset collision tracking if (hero.lastEnemyCollision) { var stillColliding = false; for (var k = 0; k < enemies.length; k++) { if (enemies[k] === hero.lastEnemyCollision && hero.intersects(enemies[k])) { stillColliding = true; break; } } if (!stillColliding) { hero.lastEnemyCollision = null; } } // Check hero-spike collisions for (var l = 0; l < spikes.length; l++) { var spike = spikes[l]; if (hero.intersects(spike)) { if (!hero.lastSpikeCollision || hero.lastSpikeCollision !== spike) { hero.takeDamage(1); hero.lastSpikeCollision = spike; } } } // Reset spike collision tracking if (hero.lastSpikeCollision) { var stillCollidingSpike = hero.intersects(hero.lastSpikeCollision); if (!stillCollidingSpike) { hero.lastSpikeCollision = null; } } // Check bullet-enemy collisions for (var m = bullets.length - 1; m >= 0; m--) { var bullet = bullets[m]; var hitEnemy = false; for (var n = 0; n < enemies.length; n++) { var enemy2 = enemies[n]; if (bullet.intersects(enemy2)) { enemy2.takeDamage(); bullet.destroy(); bullets.splice(m, 1); hitEnemy = true; break; } } if (!hitEnemy) { // Check bullet-platform collisions for (var o = 0; o < platforms.length; o++) { if (bullet.intersects(platforms[o])) { bullet.destroy(); bullets.splice(m, 1); break; } } } } // Check goal collision if (goal && hero.intersects(goal)) { if (enemies.length === 0) { LK.setScore(LK.getScore() + 100); scoreText.setText('Score: ' + LK.getScore()); if (currentLevel >= 3) { LK.showYouWin(); } else { nextLevel(); } } } };
===================================================================
--- original.js
+++ change.js
@@ -112,9 +112,9 @@
self.onGround = false;
self.health = 3;
self.maxHealth = 3;
self.moveSpeed = 8;
- self.jumpPower = -25;
+ self.jumpPower = -8;
self.canAttack = true;
self.attackCooldown = 0;
self.update = function () {
// Apply gravity
Fullscreen modern App Store landscape banner, 16:9, high definition, for a game titled "Adventure Quest: Hero's Journey" and with the description "Control a hero through challenging levels, fighting enemies and navigating obstacle courses in this action-packed adventure game.". No text on banner!
Canavar. In-Game asset. 2d. High contrast. No shadows
Kara delik. In-Game asset. 2d. High contrast. No shadows