User prompt
şu üstteki yazılardaki o yuvarlak renkleri sil
User prompt
Please fix the bug: 'TypeError: scoreText.setText is not a function' in or related to this line: 'scoreText.setText(LK.getScore().toString());' Line Number: 257
User prompt
Profesyonel Dokunuşlar ve İnteraktif Özellikler hariç hepsini yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
İnteraktif Özellikler ve Profesyonel Dokunuşlar hariç hepsini ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'healthText.style.fill = '#00ff00'; // Green for high health' Line Number: 680
User prompt
şu puan göstergesini wavei ve healt çok sade olmuş ne yapabiliriz
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var gamePos = game.toLocal(obj.parent.toGlobal({' Line Number: 550
User prompt
hiçbirşey olmuyor
User prompt
oyunun başlamasın ekranda ingilizce bir şekilde bu oyun bilgisayarda oynanabilir olarak tasarlanmıştır yazsın ve altında ok butonu olsun basınca başlasın yapabilirmisin sadece oyunun başında yazsın
User prompt
**Karanlık orman**: Eski ağaç siluetleri, gizemli sis, ilkel mağara resimleri ama üstten bakış olsun ve biz boş bir alanda olalım onlar etraftan gelsin
User prompt
karakter her vurduğunda vurmasesi sesi çalsın
User prompt
tekrar dene
User prompt
tekrar ekle
User prompt
ses müziği sürekli oyunda çalsın
User prompt
karakterimiz ve diğer dinazorlar (canavarlar) daha büyük olsun
User prompt
yine aynısı oldu büyükler daha çok canı olsun daha çok vurmak gereksin
User prompt
mesela bu dinazorlar büyükten küçüğe doğrularya küçükten büyüğe doğru canları artsın daha çok vurmamız gereksin
User prompt
bu kadarda fazla olmasın biraz azalat
User prompt
çok daha uzun olsun vurduğumuz alan
User prompt
vurduğumuz mezili daha fazla arttırır mısın
Code edit (1 edits merged)
Please save this source code
User prompt
Blue Raptor: Neon Hunter
User prompt
"Pixel art tarzında, retro-fütüristik bir dinozor avcısı oyunu tasarla. Ana karakter 'Blue Raptor', hızlı hareket eden ('Shadow Dash') ve kaotik bir bölgede ('Chaotic Area') düşman dinozorlarla savaşıyor. Düşmanlar arasında 'Delophospurus', 'Stegospurus', 'Tricerator' ve 'Velocorator' bulunsun. Özel hareketler: 'Blood Slash' (kanlı kılıç saldırısı) ve 'Energy Fall' (enerji patlaması). Arka planlar neon ışıklı, 90'lar arcade oyunu havasında olsun. Upit AI, bu oyun için karakter tasarımları ve hareketli sprite'lar üretsin." Tarz: Pixel art + retro-fütüristik (eski arcade oyunlarına gönderme). Mekanikler: Hızlı koşu ("Shadow Dash"), kanlı kılıç saldırısı ("Blood Slash"), enerji bazlı özel yetenekler. Düşmanlar: Özelleştirilmiş dinozor isimleri (örneğin "Tricerator", T-Rex ve Triceratops karışımı gibi). Atmosfer: Neon renkler, kaotik sahneler ("Chaotic Area"), oyun içi "Game Over" ekranı retro stilinde. Temel Hareketler: Yön Tuşları/WASD: Koşma ve zıplama Shadow Dash (Gölge Hızı): L-Shift tuşuyla kısa mesafe ışınlanma (dash) Blood Slash (Kanlı Kılıç): Sol tık tuşuyla yakın dövüş saldırısı (kan efektiyle) Sadece Pc İçin Olsun
User prompt
Please continue polishing my design document.
Initial prompt
"Pixel art tarzında, retro-fütüristik bir dinozor avcısı oyunu tasarla. Ana karakter 'Blue Raptor', hızlı hareket eden ('Shadow Dash') ve kaotik bir bölgede ('Chaotic Area') düşman dinozorlarla savaşıyor. Düşmanlar arasında 'Delophospurus', 'Stegospurus', 'Tricerator' ve 'Velocorator' bulunsun. Özel hareketler: 'Blood Slash' (kanlı kılıç saldırısı) ve 'Energy Fall' (enerji patlaması). Arka planlar neon ışıklı, 90'lar arcade oyunu havasında olsun. Upit AI, bu oyun için karakter tasarımları ve hareketli sprite'lar üretsin." Tarz: Pixel art + retro-fütüristik (eski arcade oyunlarına gönderme). Mekanikler: Hızlı koşu ("Shadow Dash"), kanlı kılıç saldırısı ("Blood Slash"), enerji bazlı özel yetenekler. Düşmanlar: Özelleştirilmiş dinozor isimleri (örneğin "Tricerator", T-Rex ve Triceratops karışımı gibi). Atmosfer: Neon renkler, kaotik sahneler ("Chaotic Area"), oyun içi "Game Over" ekranı retro stilinde. Temel Hareketler: Yön Tuşları/WASD: Koşma ve zıplama Shadow Dash (Gölge Hızı): L-Shift tuşuyla kısa mesafe ışınlanma (dash) Blood Slash (Kanlı Kılıç): Sol tık tuşuyla yakın dövüş saldırısı (kan efektiyle) Sadece Pc İçin Olsun
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var BlueRaptor = Container.expand(function () { var self = Container.call(this); var graphics = self.attachAsset('blueRaptor', { anchorX: 0.5, anchorY: 0.5 }); self.health = 100; self.maxHealth = 100; self.speed = 8; self.dashCooldown = 0; self.slashCooldown = 0; self.energyFallCooldown = 0; self.isMoving = false; self.facing = 1; // 1 for right, -1 for left self.update = function () { if (self.dashCooldown > 0) self.dashCooldown--; if (self.slashCooldown > 0) self.slashCooldown--; if (self.energyFallCooldown > 0) self.energyFallCooldown--; // Update graphics based on facing direction graphics.scaleX = self.facing; // Keep player in bounds if (self.x < 40) self.x = 40; if (self.x > 2008) self.x = 2008; if (self.y < 60) self.y = 60; if (self.y > 2672) self.y = 2672; }; self.shadowDash = function (targetX, targetY) { if (self.dashCooldown > 0) return; // Create dash effect var dashEffect = game.addChild(LK.getAsset('shadowDash', { anchorX: 0.5, anchorY: 0.5, x: self.x, y: self.y, alpha: 0.7 })); // Move to target position self.x = targetX; self.y = targetY; // Play dash sound LK.getSound('dash').play(); // Animate dash effect tween(dashEffect, { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 300, onFinish: function onFinish() { dashEffect.destroy(); } }); self.dashCooldown = 120; // 2 seconds at 60fps }; self.bloodSlash = function (direction) { if (self.slashCooldown > 0) return; var slash = game.addChild(LK.getAsset('bloodSlash', { anchorX: 0.5, anchorY: 0.5, x: self.x + direction.x * 100, y: self.y + direction.y * 100, rotation: Math.atan2(direction.y, direction.x), scaleX: 1.5, scaleY: 1.2 })); bloodSlashes.push(slash); // Play slash sound LK.getSound('slash').play(); // Animate slash tween(slash, { alpha: 0, scaleX: 2.0, scaleY: 1.5 }, { duration: 300, onFinish: function onFinish() { slash.destroy(); var index = bloodSlashes.indexOf(slash); if (index > -1) bloodSlashes.splice(index, 1); } }); self.slashCooldown = 30; // 0.5 seconds }; self.energyFall = function () { if (self.energyFallCooldown > 0) return; var explosion = game.addChild(LK.getAsset('energyFall', { anchorX: 0.5, anchorY: 0.5, x: self.x, y: self.y, alpha: 0.8, scaleX: 0.1, scaleY: 0.1 })); energyFalls.push(explosion); // Play explosion sound LK.getSound('explosion').play(); // Animate explosion tween(explosion, { alpha: 0, scaleX: 1, scaleY: 1 }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { explosion.destroy(); var index = energyFalls.indexOf(explosion); if (index > -1) energyFalls.splice(index, 1); } }); self.energyFallCooldown = 300; // 5 seconds }; return self; }); var Enemy = Container.expand(function (enemyType) { var self = Container.call(this); var graphics = self.attachAsset(enemyType, { anchorX: 0.5, anchorY: 0.5 }); self.enemyType = enemyType; self.health = 50; self.speed = 2; self.attackCooldown = 0; self.lastPlayerX = 0; self.lastPlayerY = 0; // Set enemy-specific properties based on size (smaller to larger) switch (enemyType) { case 'velocorator': // Smallest (60x80) self.health = 25; self.speed = 4; break; case 'delophospurus': // Small-medium (70x100) self.health = 75; self.speed = 3; break; case 'stegospurus': // Medium-large (100x90) self.health = 150; self.speed = 1.5; break; case 'tricerator': // Largest (120x80) self.health = 250; self.speed = 1; break; } self.update = function () { if (self.attackCooldown > 0) self.attackCooldown--; // AI: Move towards player var dx = player.x - self.x; var dy = player.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { var moveX = dx / distance * self.speed; var moveY = dy / distance * self.speed; self.x += moveX; self.y += moveY; // Face player graphics.scaleX = dx > 0 ? 1 : -1; } // Keep enemy in bounds if (self.x < 0) self.x = 0; if (self.x > 2048) self.x = 2048; if (self.y < 0) self.y = 0; if (self.y > 2732) self.y = 2732; }; self.takeDamage = function (damage) { self.health -= damage; // Flash red when hit tween(graphics, { tint: 0xff0000 }, { duration: 100, onFinish: function onFinish() { tween(graphics, { tint: 0xffffff }, { duration: 100 }); } }); LK.getSound('vurmasesi').play(); if (self.health <= 0) { LK.setScore(LK.getScore() + 25); var scoreText = LK.gui.topLeft.children[0]; if (scoreText) { scoreText.setText(LK.getScore().toString()); } // Chance to drop power-up if (Math.random() < 0.3) { spawnPowerUp(self.x, self.y); } return true; // Enemy is dead } return false; }; return self; }); var PowerUp = Container.expand(function () { var self = Container.call(this); var graphics = self.attachAsset('powerUp', { anchorX: 0.5, anchorY: 0.5 }); self.collectTimer = 0; self.update = function () { self.collectTimer++; // Pulse effect var pulse = Math.sin(self.collectTimer * 0.1) * 0.3 + 1; graphics.scaleX = pulse; graphics.scaleY = pulse; // Auto-destroy after 10 seconds if (self.collectTimer > 600) { self.destroy(); var index = powerUps.indexOf(self); if (index > -1) powerUps.splice(index, 1); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000022 }); /**** * Game Code ****/ // Game variables var player; var enemies = []; var bloodSlashes = []; var energyFalls = []; var powerUps = []; var waveNumber = 1; var enemiesSpawned = 0; var enemiesPerWave = 5; var spawnTimer = 0; var backgroundPulse = 0; var lastTouchX = 0; var lastTouchY = 0; var moveKeys = {}; var forestElements = []; var mistElements = []; var gameStarted = false; var welcomeScreen = null; var startButton = null; // Create forest background elements function createForestBackground() { // Left side trees for (var i = 0; i < 8; i++) { var leftTree = game.addChild(LK.getAsset('treeLeft', { anchorX: 1, anchorY: 1, x: -50 + Math.random() * 150, y: 200 + i * 300, alpha: 0.6 + Math.random() * 0.3, scaleX: 0.8 + Math.random() * 0.4, scaleY: 0.8 + Math.random() * 0.4 })); forestElements.push(leftTree); } // Right side trees for (var i = 0; i < 8; i++) { var rightTree = game.addChild(LK.getAsset('treeRight', { anchorX: 0, anchorY: 1, x: 1950 + Math.random() * 150, y: 150 + i * 320, alpha: 0.5 + Math.random() * 0.4, scaleX: 0.7 + Math.random() * 0.5, scaleY: 0.9 + Math.random() * 0.3 })); forestElements.push(rightTree); } // Top edge trees for (var i = 0; i < 6; i++) { var topTree = game.addChild(LK.getAsset('treeTop', { anchorX: 0.5, anchorY: 1, x: 300 + i * 280, y: -20 + Math.random() * 100, alpha: 0.4 + Math.random() * 0.3, scaleX: 0.6 + Math.random() * 0.4, scaleY: 0.8 + Math.random() * 0.4 })); forestElements.push(topTree); } // Bottom edge trees for (var i = 0; i < 6; i++) { var bottomTree = game.addChild(LK.getAsset('treeBottom', { anchorX: 0.5, anchorY: 0, x: 250 + i * 300, y: 2650 + Math.random() * 100, alpha: 0.5 + Math.random() * 0.2, scaleX: 0.7 + Math.random() * 0.3, scaleY: 0.9 + Math.random() * 0.2 })); forestElements.push(bottomTree); } // Create mysterious mist effects for (var i = 0; i < 12; i++) { var mist = game.addChild(LK.getAsset('mistEffect', { anchorX: 0.5, anchorY: 0.5, x: 200 + Math.random() * 1600, y: 200 + Math.random() * 2300, alpha: 0.1 + Math.random() * 0.15, scaleX: 1 + Math.random() * 2, scaleY: 0.5 + Math.random() * 1 })); mistElements.push(mist); } // Add some cave art/ancient symbols for (var i = 0; i < 4; i++) { var caveArt = game.addChild(LK.getAsset('caveArt', { anchorX: 0.5, anchorY: 0.5, x: 100 + Math.random() * 150, y: 300 + i * 500, alpha: 0.3 + Math.random() * 0.2, rotation: Math.random() * Math.PI * 2 })); forestElements.push(caveArt); } } // Create welcome screen function createWelcomeScreen() { // Create semi-transparent background welcomeScreen = game.addChild(LK.getAsset('treeTop', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, alpha: 0.8, scaleX: 10, scaleY: 15, tint: 0x000000 })); // Create welcome message var welcomeText = new Text2('This game is designed\nto be played on computer', { size: 80, fill: '#ffffff' }); welcomeText.anchor.set(0.5, 0.5); welcomeText.x = 1024; welcomeText.y = 1100; LK.gui.center.addChild(welcomeText); // Create start button (arrow) startButton = LK.getAsset('powerUp', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1600, scaleX: 3, scaleY: 3, tint: 0x00ff00 }); LK.gui.center.addChild(startButton); // Add pulsing effect to start button tween(startButton, { scaleX: 3.5, scaleY: 3.5 }, { duration: 800, yoyo: true, repeat: -1 }); } // Create welcome screen first createWelcomeScreen(); // Create forest background createForestBackground(); // Spawn power-up function function spawnPowerUp(x, y) { var powerUp = game.addChild(new PowerUp()); powerUp.x = x; powerUp.y = y; powerUps.push(powerUp); } // Spawn enemy function function spawnEnemy() { var enemyTypes = ['delophospurus', 'stegospurus', 'tricerator', 'velocorator']; var randomType = enemyTypes[Math.floor(Math.random() * enemyTypes.length)]; var enemy = game.addChild(new Enemy(randomType)); // Spawn at random edge var edge = Math.floor(Math.random() * 4); switch (edge) { case 0: // Top enemy.x = Math.random() * 2048; enemy.y = -50; break; case 1: // Right enemy.x = 2098; enemy.y = Math.random() * 2732; break; case 2: // Bottom enemy.x = Math.random() * 2048; enemy.y = 2782; break; case 3: // Left enemy.x = -50; enemy.y = Math.random() * 2732; break; } enemies.push(enemy); } // Function to start the game function startGame() { if (gameStarted) return; gameStarted = true; // Remove welcome screen if (welcomeScreen) { welcomeScreen.destroy(); welcomeScreen = null; } // Remove start button if (startButton) { startButton.destroy(); startButton = null; } // Clear GUI LK.gui.center.removeChildren(); // Create player player = game.addChild(new BlueRaptor()); player.x = 1024; player.y = 1366; // Create UI var scoreText = new Text2('Score: 0', { size: 60, fill: '#00ffff' }); scoreText.anchor.set(0, 0); scoreText.x = 120; scoreText.y = 50; LK.gui.topLeft.addChild(scoreText); var healthText = new Text2('Health: 100', { size: 60, fill: '#ff0066' }); healthText.anchor.set(1, 0); LK.gui.topRight.addChild(healthText); var waveText = new Text2('Wave: 1', { size: 60, fill: '#ffff00' }); waveText.anchor.set(0.5, 0); LK.gui.top.addChild(waveText); // Start background music with fade-in effect LK.playMusic('ses', { loop: true, fade: { start: 0, end: 0.7, duration: 1000 } }); } // Touch controls game.down = function (x, y, obj) { if (!gameStarted) { // Check if clicked on start button area var buttonBounds = { x: 1024 - 100, y: 1600 - 100, width: 200, height: 200 }; if (x >= buttonBounds.x && x <= buttonBounds.x + buttonBounds.width && y >= buttonBounds.y && y <= buttonBounds.y + buttonBounds.height) { startGame(); } return; } lastTouchX = x; lastTouchY = y; // Double tap for shadow dash if (obj.tapCount === 2) { player.shadowDash(x, y); } }; game.up = function (x, y, obj) { if (!gameStarted) return; var dx = x - player.x; var dy = y - player.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 50) { // Blood slash in direction of touch var direction = { x: dx / distance, y: dy / distance }; player.bloodSlash(direction); } else { // Energy fall at current position player.energyFall(); } }; game.move = function (x, y, obj) { if (!gameStarted) return; // Move player towards touch position var dx = x - player.x; var dy = y - player.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 20) { var moveX = dx / distance * player.speed; var moveY = dy / distance * player.speed; player.x += moveX; player.y += moveY; player.facing = dx > 0 ? 1 : -1; player.isMoving = true; } else { player.isMoving = false; } }; // Main game loop game.update = function () { backgroundPulse += 0.05; // Animate background color with darker forest tones var pulseValue = Math.sin(backgroundPulse) * 0.08 + 0.08; var bgColor = 0x001100 + Math.floor(pulseValue * 180) * 0x010101; game.setBackgroundColor(bgColor); // Animate mist effects for (var i = 0; i < mistElements.length; i++) { var mist = mistElements[i]; mist.alpha = 0.1 + Math.sin(backgroundPulse + i * 0.5) * 0.05; mist.x += Math.sin(backgroundPulse * 0.3 + i) * 0.5; } // Only run game logic after game started if (!gameStarted) return; // Update UI var healthText = LK.gui.topRight.children[0]; if (healthText) { healthText.setText('Health: ' + player.health); } // Spawn enemies if (enemiesSpawned < enemiesPerWave) { spawnTimer++; if (spawnTimer > 120) { // Every 2 seconds spawnEnemy(); enemiesSpawned++; spawnTimer = 0; } } // Check for wave completion if (enemiesSpawned >= enemiesPerWave && enemies.length === 0) { waveNumber++; enemiesPerWave += 2; enemiesSpawned = 0; var waveText = LK.gui.top.children[0]; if (waveText) { waveText.setText('Wave: ' + waveNumber); } // Restore some health player.health = Math.min(player.health + 20, player.maxHealth); } // Enemy vs player collision for (var i = enemies.length - 1; i >= 0; i--) { var enemy = enemies[i]; if (enemy.intersects(player)) { if (!enemy.lastPlayerCollision) { player.health -= 10; enemy.lastPlayerCollision = true; // Push player away var dx = player.x - enemy.x; var dy = player.y - enemy.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { player.x += dx / distance * 30; player.y += dy / distance * 30; } // Screen shake effect LK.effects.flashScreen(0xff0000, 200); if (player.health <= 0) { LK.showGameOver(); } } } else { enemy.lastPlayerCollision = false; } } // Blood slash vs enemies for (var i = bloodSlashes.length - 1; i >= 0; i--) { var slash = bloodSlashes[i]; for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (slash.intersects(enemy)) { if (enemy.takeDamage(50)) { enemy.destroy(); enemies.splice(j, 1); } } } } // Energy fall vs enemies for (var i = energyFalls.length - 1; i >= 0; i--) { var explosion = energyFalls[i]; for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (explosion.intersects(enemy)) { if (!enemy.lastExplosionHit) { enemy.lastExplosionHit = true; if (enemy.takeDamage(100)) { enemy.destroy(); enemies.splice(j, 1); } } } else { enemy.lastExplosionHit = false; } } } // Power-up collection for (var i = powerUps.length - 1; i >= 0; i--) { var powerUp = powerUps[i]; if (powerUp.intersects(player)) { // Restore health and reset cooldowns player.health = Math.min(player.health + 30, player.maxHealth); player.dashCooldown = Math.max(0, player.dashCooldown - 60); player.slashCooldown = Math.max(0, player.slashCooldown - 30); player.energyFallCooldown = Math.max(0, player.energyFallCooldown - 120); powerUp.destroy(); powerUps.splice(i, 1); } } };
===================================================================
--- original.js
+++ change.js
@@ -193,9 +193,12 @@
});
LK.getSound('vurmasesi').play();
if (self.health <= 0) {
LK.setScore(LK.getScore() + 25);
- scoreText.setText(LK.getScore().toString());
+ var scoreText = LK.gui.topLeft.children[0];
+ if (scoreText) {
+ scoreText.setText(LK.getScore().toString());
+ }
// Chance to drop power-up
if (Math.random() < 0.3) {
spawnPowerUp(self.x, self.y);
}
@@ -253,8 +256,11 @@
var lastTouchY = 0;
var moveKeys = {};
var forestElements = [];
var mistElements = [];
+var gameStarted = false;
+var welcomeScreen = null;
+var startButton = null;
// Create forest background elements
function createForestBackground() {
// Left side trees
for (var i = 0; i < 8; i++) {
@@ -333,44 +339,55 @@
}));
forestElements.push(caveArt);
}
}
+// Create welcome screen
+function createWelcomeScreen() {
+ // Create semi-transparent background
+ welcomeScreen = game.addChild(LK.getAsset('treeTop', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1366,
+ alpha: 0.8,
+ scaleX: 10,
+ scaleY: 15,
+ tint: 0x000000
+ }));
+ // Create welcome message
+ var welcomeText = new Text2('This game is designed\nto be played on computer', {
+ size: 80,
+ fill: '#ffffff'
+ });
+ welcomeText.anchor.set(0.5, 0.5);
+ welcomeText.x = 1024;
+ welcomeText.y = 1100;
+ LK.gui.center.addChild(welcomeText);
+ // Create start button (arrow)
+ startButton = LK.getAsset('powerUp', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1600,
+ scaleX: 3,
+ scaleY: 3,
+ tint: 0x00ff00
+ });
+ LK.gui.center.addChild(startButton);
+ // Add pulsing effect to start button
+ tween(startButton, {
+ scaleX: 3.5,
+ scaleY: 3.5
+ }, {
+ duration: 800,
+ yoyo: true,
+ repeat: -1
+ });
+}
+// Create welcome screen first
+createWelcomeScreen();
// Create forest background
createForestBackground();
-// Create player
-player = game.addChild(new BlueRaptor());
-player.x = 1024;
-player.y = 1366;
-// Create UI
-var scoreText = new Text2('Score: 0', {
- size: 60,
- fill: '#00ffff'
-});
-scoreText.anchor.set(0, 0);
-scoreText.x = 120;
-scoreText.y = 50;
-LK.gui.topLeft.addChild(scoreText);
-var healthText = new Text2('Health: 100', {
- size: 60,
- fill: '#ff0066'
-});
-healthText.anchor.set(1, 0);
-LK.gui.topRight.addChild(healthText);
-var waveText = new Text2('Wave: 1', {
- size: 60,
- fill: '#ffff00'
-});
-waveText.anchor.set(0.5, 0);
-LK.gui.top.addChild(waveText);
-// Start background music with fade-in effect
-LK.playMusic('ses', {
- loop: true,
- fade: {
- start: 0,
- end: 0.7,
- duration: 1000
- }
-});
// Spawn power-up function
function spawnPowerUp(x, y) {
var powerUp = game.addChild(new PowerUp());
powerUp.x = x;
@@ -407,18 +424,83 @@
break;
}
enemies.push(enemy);
}
+// Function to start the game
+function startGame() {
+ if (gameStarted) return;
+ gameStarted = true;
+ // Remove welcome screen
+ if (welcomeScreen) {
+ welcomeScreen.destroy();
+ welcomeScreen = null;
+ }
+ // Remove start button
+ if (startButton) {
+ startButton.destroy();
+ startButton = null;
+ }
+ // Clear GUI
+ LK.gui.center.removeChildren();
+ // Create player
+ player = game.addChild(new BlueRaptor());
+ player.x = 1024;
+ player.y = 1366;
+ // Create UI
+ var scoreText = new Text2('Score: 0', {
+ size: 60,
+ fill: '#00ffff'
+ });
+ scoreText.anchor.set(0, 0);
+ scoreText.x = 120;
+ scoreText.y = 50;
+ LK.gui.topLeft.addChild(scoreText);
+ var healthText = new Text2('Health: 100', {
+ size: 60,
+ fill: '#ff0066'
+ });
+ healthText.anchor.set(1, 0);
+ LK.gui.topRight.addChild(healthText);
+ var waveText = new Text2('Wave: 1', {
+ size: 60,
+ fill: '#ffff00'
+ });
+ waveText.anchor.set(0.5, 0);
+ LK.gui.top.addChild(waveText);
+ // Start background music with fade-in effect
+ LK.playMusic('ses', {
+ loop: true,
+ fade: {
+ start: 0,
+ end: 0.7,
+ duration: 1000
+ }
+ });
+}
// Touch controls
game.down = function (x, y, obj) {
+ if (!gameStarted) {
+ // Check if clicked on start button area
+ var buttonBounds = {
+ x: 1024 - 100,
+ y: 1600 - 100,
+ width: 200,
+ height: 200
+ };
+ if (x >= buttonBounds.x && x <= buttonBounds.x + buttonBounds.width && y >= buttonBounds.y && y <= buttonBounds.y + buttonBounds.height) {
+ startGame();
+ }
+ return;
+ }
lastTouchX = x;
lastTouchY = y;
// Double tap for shadow dash
if (obj.tapCount === 2) {
player.shadowDash(x, y);
}
};
game.up = function (x, y, obj) {
+ if (!gameStarted) return;
var dx = x - player.x;
var dy = y - player.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 50) {
@@ -433,8 +515,9 @@
player.energyFall();
}
};
game.move = function (x, y, obj) {
+ if (!gameStarted) return;
// Move player towards touch position
var dx = x - player.x;
var dy = y - player.y;
var distance = Math.sqrt(dx * dx + dy * dy);
@@ -461,10 +544,15 @@
var mist = mistElements[i];
mist.alpha = 0.1 + Math.sin(backgroundPulse + i * 0.5) * 0.05;
mist.x += Math.sin(backgroundPulse * 0.3 + i) * 0.5;
}
+ // Only run game logic after game started
+ if (!gameStarted) return;
// Update UI
- healthText.setText('Health: ' + player.health);
+ var healthText = LK.gui.topRight.children[0];
+ if (healthText) {
+ healthText.setText('Health: ' + player.health);
+ }
// Spawn enemies
if (enemiesSpawned < enemiesPerWave) {
spawnTimer++;
if (spawnTimer > 120) {
@@ -478,9 +566,12 @@
if (enemiesSpawned >= enemiesPerWave && enemies.length === 0) {
waveNumber++;
enemiesPerWave += 2;
enemiesSpawned = 0;
- waveText.setText('Wave: ' + waveNumber);
+ var waveText = LK.gui.top.children[0];
+ if (waveText) {
+ waveText.setText('Wave: ' + waveNumber);
+ }
// Restore some health
player.health = Math.min(player.health + 20, player.maxHealth);
}
// Enemy vs player collision
bir rüzgar gibi bir şey retro oyunlardaki vurma efekti gibi olsun lazer ile rüzgarın karışımı birşey. In-Game asset. 2d. High contrast. No shadows
90'lardaki retro oyun dinazoru. vahşi olsun In-Game asset. 2d. High contrast. No shadows
90'lardaki retro oyun dinazoru. vahşi olsun. sarı olsun In-Game asset. 2d. High contrast. No shadows
90'lardaki retro oyun dinazoru. vahşi olsun. mavi ile sarı karışımı bir renk olsun In-Game asset. 2d. High contrast. No shadows
90'lardaki retro oyun dinazoru. vahşi olsun. diğer canavarlarda gibi olmayan renk olsun In-Game asset. 2d. High contrast. No shadows
90'lardaki retro oyun dinazoru. vahşi olsun. yeşil renk olsun In-Game asset. 2d. High contrast. No shadows