User prompt
1 tane boss kestik Ten sonra oyun zorlassin wave olsun her boşa kestigimisde 1 wave artsın dusmanlarda
User prompt
3 ccanli şeyler daha hızlı vursun ve yukarda bossun ne zaman gelcegi yazsın
User prompt
Sadece bosslarin üstünde canı yazmasın hepsinde yazsın ve 2 3 canlı küçük şeyler de doğsun onlar daha güçlü olsun
User prompt
Ve ustende canı gözüksün
User prompt
Boss oldurdugumuzde shop açılmasın
User prompt
Shop yerini küçült sigadak şekilde yap
User prompt
Sıgmadı
User prompt
Shop tuşuna basıldığında başka yükseltmeleri görelim
User prompt
Advence shop olmasin oda shop un devamı olsun energy yükseltme gibi temel şeyler olsun
User prompt
Shopta başka şeylerde olsun energy yükseltme gibi
User prompt
Bide shoptan mesala 60 saniye işe yarayan bişi aldın sayaç olsun
User prompt
Tuş biraz daha belirgin olsun
User prompt
O ileri gitme yeri shop yerinin sağında olsun
User prompt
O ileri gitme tuşu sadece shop acildiginda gözüksün
User prompt
Shop yerinde sağ üste bir tuş olsun o tuşa basıldığında başka şeyler olsun eski şeyler soldada geriye gitme. Olsun
User prompt
Shop yerinde başka şeylerde olsun
User prompt
Shop tuşuna basıldığında düşmanlar silinsin close tuşuna basıldığında da devam etsin
User prompt
Her on adam yerine değilde mağaza tuşu olsun o tusa basıldığında mağaza açılsın
User prompt
Please fix the bug: 'TypeError: LK.pauseGame is not a function' in or related to this line: 'LK.pauseGame();' Line Number: 588
User prompt
Shop yerine gelince oyun dursun ve her dusman oldurdugumuzda oyun zorlassin ama çok değil
User prompt
Ve point yerine para olsun her 10 adam oldurdugumuzde bir mağaza olsun enerji hızlandırma ve enerjiyi yükseltme olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Normal mod yanında bir buton olsun kucuk ona basınca 3 ki bida basınca 8 li bida basinca 16 gibi
User prompt
Ve triple shoot sununun yanında ok olsun onla ileri gidelim mesala ondan sonra 8 li ok atma olsun geride gidelim
User prompt
Boss vurdugumuzda point artmasin
User prompt
Boss doğduğunda sadece boss olsun
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Archer = Container.expand(function () { var self = Container.call(this); var archerGraphics = self.attachAsset('archer', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var Arrow = Container.expand(function () { var self = Container.call(this); var arrowGraphics = self.attachAsset('arrow', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 0; self.speedY = 0; self.update = function () { self.x += self.speedX; self.y += self.speedY; }; return self; }); var Boss = Container.expand(function () { var self = Container.call(this); var bossGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2 }); self.health = 10; self.shootTimer = 0; self.shootRate = 60; // Faster shooting than regular enemies self.moveToNewPosition = function () { var newX = Math.random() * (2048 - 400) + 200; var newY = Math.random() * (2732 - 400) + 200; // Make sure boss doesn't spawn too close to archer var distToArcher = Math.sqrt(Math.pow(newX - archer.x, 2) + Math.pow(newY - archer.y, 2)); if (distToArcher < 300) { newX = Math.random() * (2048 - 600) + 300; if (newX > archer.x - 300 && newX < archer.x + 300) { newX += 400; } } // Animate movement to new position tween(self, { x: newX, y: newY }, { duration: 800, easing: tween.easeInOut }); }; self.update = function () { self.shootTimer++; if (self.shootTimer >= self.shootRate) { self.shootTimer = 0; // Shoot at player var dirX = archer.x - self.x; var dirY = archer.y - self.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); var normalX = dirX / distance; var normalY = dirY / distance; // Make boss face the shooting direction self.rotation = Math.atan2(normalY, normalX); // Boss shoots 3 arrows at once for (var i = 0; i < 3; i++) { var spreadAngle = (i - 1) * 0.3; // More spread than triple shot var finalAngle = Math.atan2(normalY, normalX) + spreadAngle; var finalNormalX = Math.cos(finalAngle); var finalNormalY = Math.sin(finalAngle); var enemyArrow = new EnemyArrow(); enemyArrow.x = self.x; enemyArrow.y = self.y; enemyArrow.speedX = finalNormalX * 10; enemyArrow.speedY = finalNormalY * 10; enemyArrow.rotation = finalAngle; enemyArrows.push(enemyArrow); game.addChild(enemyArrow); } } }; return self; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.shootTimer = 0; self.shootRate = 120 + Math.random() * 60; // Random shooting interval self.update = function () { // Enemies don't move, they stay in place and shoot self.shootTimer++; if (self.shootTimer >= self.shootRate) { self.shootTimer = 0; // Shoot at player var dirX = archer.x - self.x; var dirY = archer.y - self.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); var normalX = dirX / distance; var normalY = dirY / distance; // Make enemy face the shooting direction self.rotation = Math.atan2(normalY, normalX); var enemyArrow = new EnemyArrow(); enemyArrow.x = self.x; enemyArrow.y = self.y; enemyArrow.speedX = normalX * 8; enemyArrow.speedY = normalY * 8; enemyArrow.rotation = Math.atan2(normalY, normalX); enemyArrows.push(enemyArrow); game.addChild(enemyArrow); } }; return self; }); var EnemyArrow = Container.expand(function () { var self = Container.call(this); var arrowGraphics = self.attachAsset('enemyArrow', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 0; self.speedY = 0; self.update = function () { self.x += self.speedX; self.y += self.speedY; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ var archer = game.addChild(new Archer()); archer.x = 150; archer.y = 2732 / 2; var arrows = []; var enemies = []; var enemyArrows = []; var enemySpawnTimer = 0; var enemySpawnRate = 120; // frames between spawns var playerHealth = 10; var maxEnemies = 1; // Start with 1 enemy, increase over time var energy = 100; var energyRegenTimer = 0; var isShooting = false; var shootingTimer = 0; var money = storage.money || 0; var kills = storage.kills || 0; var shopVisible = false; var gamePaused = false; var energyUpgradeLevel = storage.energyUpgradeLevel || 0; var speedUpgradeLevel = storage.speedUpgradeLevel || 0; var moneyTxt = new Text2('Money: 0', { size: 100, fill: 0xFFD700 }); moneyTxt.anchor.set(0.5, 0); LK.gui.top.addChild(moneyTxt); moneyTxt.setText('Money: ' + money); var energyTxt = new Text2('Energy: 100', { size: 80, fill: 0x00ff00 }); energyTxt.anchor.set(1, 0); LK.gui.topRight.addChild(energyTxt); energyTxt.x = -20; energyTxt.y = 20; var healthTxt = new Text2('Health: 10', { size: 80, fill: 0xff0000 }); healthTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(healthTxt); healthTxt.x = 120; // Avoid the platform menu icon healthTxt.y = 20; var autoShootTimer = 0; var autoBattleActive = false; // Create hack mode button var autoBattleButton = new Text2('HACK MODE', { size: 80, fill: 0xff0000 }); autoBattleButton.anchor.set(0.5, 1); LK.gui.bottom.addChild(autoBattleButton); autoBattleButton.y = -50; // Button click handler autoBattleButton.down = function (x, y, obj) { autoBattleActive = !autoBattleActive; if (autoBattleActive) { autoBattleButton.setText('STOP HACK'); autoBattleButton.tint = 0x00ff00; // Green when active } else { autoBattleButton.setText('HACK MODE'); autoBattleButton.tint = 0xff0000; // Red when inactive } ; }; // Triple shoot variables var tripleShootActive = false; var tripleShootTimer = 0; var boss = null; var bossHealth = 10; var bossSpawnScore = 200; // Upgrade system variables var upgradeLevel = 0; // 0=normal, 1=triple, 2=octa, 3=16-arrow var upgradeNames = ['NORMAL', 'TRIPLE', 'OCTA', '16-ARROW']; var upgradeArrowCounts = [1, 3, 8, 16]; // Create cycling upgrade button var upgradeButton = new Text2('NORMAL', { size: 50, fill: 0x00ff00 }); upgradeButton.anchor.set(0.5, 1); LK.gui.bottom.addChild(upgradeButton); upgradeButton.y = -250; // Cycling button handler upgradeButton.down = function (x, y, obj) { upgradeLevel = (upgradeLevel + 1) % upgradeNames.length; upgradeButton.setText(upgradeNames[upgradeLevel]); // Update triple shoot active state based on upgrade level tripleShootActive = upgradeLevel > 0; }; // Shop UI elements var shopContainer = new Container(); var shopBackground = LK.getAsset('shop_bg', { width: 1600, height: 1200, color: 0x444444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); shopContainer.addChild(shopBackground); var shopTitle = new Text2('SHOP', { size: 120, fill: 0xFFFFFF }); shopTitle.anchor.set(0.5, 0.5); shopTitle.y = -400; shopContainer.addChild(shopTitle); // Energy upgrade button var energyUpgradeBtn = new Text2('Energy +10 (Cost: 50)', { size: 80, fill: 0x00FF00 }); energyUpgradeBtn.anchor.set(0.5, 0.5); energyUpgradeBtn.y = -200; shopContainer.addChild(energyUpgradeBtn); // Speed upgrade button var speedUpgradeBtn = new Text2('Speed +20% (Cost: 75)', { size: 80, fill: 0x0080FF }); speedUpgradeBtn.anchor.set(0.5, 0.5); speedUpgradeBtn.y = -50; shopContainer.addChild(speedUpgradeBtn); // Energy regen upgrade button var regenUpgradeBtn = new Text2('Regen +1/sec (Cost: 100)', { size: 80, fill: 0xFF8000 }); regenUpgradeBtn.anchor.set(0.5, 0.5); regenUpgradeBtn.y = 100; shopContainer.addChild(regenUpgradeBtn); // Close shop button var closeShopBtn = new Text2('CLOSE', { size: 80, fill: 0xFF0000 }); closeShopBtn.anchor.set(0.5, 0.5); closeShopBtn.y = 300; shopContainer.addChild(closeShopBtn); shopContainer.x = 2048 / 2; shopContainer.y = 2732 / 2; shopContainer.visible = false; // Create shop button var shopButton = new Text2('SHOP', { size: 60, fill: 0xFFD700 }); shopButton.anchor.set(0.5, 1); LK.gui.bottom.addChild(shopButton); shopButton.x = -300; shopButton.y = -50; // Shop button handler shopButton.down = function (x, y, obj) { shopVisible = true; shopContainer.visible = true; // Pause the game when shop opens gamePaused = true; // Clear all enemies when shop opens for (var e = enemies.length - 1; e >= 0; e--) { enemies[e].destroy(); enemies.splice(e, 1); } // Clear all enemy arrows when shop opens for (var a = enemyArrows.length - 1; a >= 0; a--) { enemyArrows[a].destroy(); enemyArrows.splice(a, 1); } // Clear boss when shop opens if (boss) { boss.destroy(); boss = null; } }; // Add shop event handlers energyUpgradeBtn.down = function (x, y, obj) { if (money >= 50) { money -= 50; energyUpgradeLevel++; energy += 10; if (energy > 100 + energyUpgradeLevel * 10) energy = 100 + energyUpgradeLevel * 10; storage.money = money; storage.energyUpgradeLevel = energyUpgradeLevel; moneyTxt.setText('Money: ' + money); energyTxt.setText('Energy: ' + energy); energyUpgradeBtn.setText('Energy +10 (Cost: ' + (50 + energyUpgradeLevel * 25) + ')'); } }; speedUpgradeBtn.down = function (x, y, obj) { if (money >= 75) { money -= 75; speedUpgradeLevel++; storage.money = money; storage.speedUpgradeLevel = speedUpgradeLevel; moneyTxt.setText('Money: ' + money); speedUpgradeBtn.setText('Speed +20% (Cost: ' + (75 + speedUpgradeLevel * 35) + ')'); } }; regenUpgradeBtn.down = function (x, y, obj) { if (money >= 100) { money -= 100; storage.money = money; moneyTxt.setText('Money: ' + money); } }; closeShopBtn.down = function (x, y, obj) { shopVisible = false; shopContainer.visible = false; // Resume the game when shop closes gamePaused = false; // Increase difficulty slightly each time shop closes if (maxEnemies < 8) { maxEnemies++; } if (enemySpawnRate > 20) { enemySpawnRate -= 2; } }; game.addChild(shopContainer); // Manual shooting - touch screen to shoot game.down = function (x, y, obj) { // Only allow manual shooting when hack mode is not active if (!autoBattleActive && energy > 0) { // Convert touch position to game coordinates // Check if obj and obj.parent exist before calling toGlobal if (obj && obj.parent && obj.parent.toGlobal) { var gamePos = game.toLocal(obj.parent.toGlobal({ x: x, y: y })); shootArrowAtTarget(gamePos.x, gamePos.y); } else { // Fallback: use x, y directly as they should already be in the correct coordinate system shootArrowAtTarget(x, y); } } }; function shootArrowAtTarget(targetX, targetY) { // Check if player has enough energy if (energy <= 0) { return; } // Calculate direction from archer to target point var dirX = targetX - archer.x; var dirY = targetY - archer.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); // Normalize direction var normalX = dirX / distance; var normalY = dirY / distance; // Calculate base angle for arrow direction var baseAngle = Math.atan2(normalY, normalX); // Make archer face the shooting direction archer.rotation = baseAngle; // Fire arrows based on upgrade level var arrowCount = upgradeArrowCounts[upgradeLevel]; var energyCost = upgradeLevel === 0 ? 2 : upgradeLevel === 1 ? 6 : upgradeLevel === 2 ? 12 : 20; // Normal: 2, Triple: 6, Octa: 12, 16-Arrow: 20 // Check if we have enough energy for the shot type if (energy < energyCost) { return; } for (var i = 0; i < arrowCount; i++) { // Add spread based on upgrade level var spreadAngle = 0; if (upgradeLevel === 1) { // Triple shot spreadAngle = (i - 1) * 0.2; // -0.2, 0, 0.2 radians spread } else if (upgradeLevel === 2) { // Octa shot spreadAngle = (i - 3.5) * 0.15; // Spread 8 arrows in fan pattern } else if (upgradeLevel === 3) { // 16-arrow shot spreadAngle = (i - 7.5) * 0.12; // Spread 16 arrows in wide fan pattern } var finalAngle = baseAngle + spreadAngle; var finalNormalX = Math.cos(finalAngle); var finalNormalY = Math.sin(finalAngle); // Create arrow var newArrow = new Arrow(); newArrow.x = archer.x; newArrow.y = archer.y; var arrowSpeed = 15 + speedUpgradeLevel * 3; newArrow.speedX = finalNormalX * arrowSpeed; newArrow.speedY = finalNormalY * arrowSpeed; // Rotate arrow to face direction newArrow.rotation = finalAngle; arrows.push(newArrow); game.addChild(newArrow); } LK.getSound('shoot').play(); // Decrease energy energy -= energyCost; // Set shooting state isShooting = true; shootingTimer = 0; // Update energy display energyTxt.setText('Energy: ' + energy); // Change color based on energy level if (energy <= 20) { energyTxt.tint = 0xff0000; // Red when low } else if (energy <= 50) { energyTxt.tint = 0xffff00; // Yellow when medium } else { energyTxt.tint = 0x00ff00; // Green when high } } game.update = function () { // Skip all game logic when game is paused (shop is open) if (gamePaused) { return; } // Automatic shooting logic - only when hack mode is active if (autoBattleActive) { autoShootTimer++; if (autoShootTimer >= 15) { // Shoot every 0.25 seconds (faster rate for hack mode) autoShootTimer = 0; // Shoot at boss first if present, then at all enemies var targets = []; if (boss) { targets.push(boss); } for (var e = 0; e < enemies.length; e++) { if (enemies[e]) { targets.push(enemies[e]); } } for (var t = 0; t < targets.length; t++) { var target = targets[t]; // Calculate direction from archer to target var dirX = target.x - archer.x; var dirY = target.y - archer.y; var distance = Math.sqrt(dirX * dirX + dirY * dirY); // Normalize direction var normalX = dirX / distance; var normalY = dirY / distance; // Make archer face the shooting direction archer.rotation = Math.atan2(normalY, normalX); // Create arrow without energy cost var newArrow = new Arrow(); newArrow.x = archer.x; newArrow.y = archer.y; newArrow.speedX = normalX * 15; newArrow.speedY = normalY * 15; // Rotate arrow to face direction newArrow.rotation = Math.atan2(normalY, normalX); arrows.push(newArrow); game.addChild(newArrow); } // Play shoot sound if we shot any arrows if (targets.length > 0) { LK.getSound('shoot').play(); } } } // Update shooting timer if (isShooting) { shootingTimer++; if (shootingTimer >= 30) { // Stop shooting state after 0.5 seconds isShooting = false; } } // Update energy regeneration only when not shooting (every 60 frames = 1 second at 60 FPS) if (!isShooting) { energyRegenTimer++; if (energyRegenTimer >= 60) { energyRegenTimer = 0; var maxEnergy = 100 + energyUpgradeLevel * 10; if (energy < maxEnergy) { energy += 1; // Update energy display energyTxt.setText('Energy: ' + energy); // Change color based on energy level if (energy <= 20) { energyTxt.tint = 0xff0000; // Red when low } else if (energy <= 50) { energyTxt.tint = 0xffff00; // Yellow when medium } else { energyTxt.tint = 0x00ff00; // Green when high } } } } else { energyRegenTimer = 0; // Reset regen timer when shooting } // Spawn enemies randomly on screen when needed (only when no boss is active) if (!boss && enemies.length < maxEnemies) { enemySpawnTimer++; if (enemySpawnTimer >= enemySpawnRate) { enemySpawnTimer = 0; // Spawn new enemy at random position var newEnemy = new Enemy(); newEnemy.x = Math.random() * (2048 - 200) + 100; newEnemy.y = Math.random() * (2732 - 200) + 100; // Make sure enemy doesn't spawn too close to archer var distToArcher = Math.sqrt(Math.pow(newEnemy.x - archer.x, 2) + Math.pow(newEnemy.y - archer.y, 2)); if (distToArcher < 200) { // Respawn farther away newEnemy.x = Math.random() * (2048 - 400) + 200; if (newEnemy.x > archer.x - 200 && newEnemy.x < archer.x + 200) { newEnemy.x += 300; } } enemies.push(newEnemy); game.addChild(newEnemy); } } // Update arrows for (var i = arrows.length - 1; i >= 0; i--) { var arrow = arrows[i]; // Remove arrows that hit walls or go off screen if (arrow.x >= 2048 || arrow.x <= 0 || arrow.y >= 2732 || arrow.y <= 0) { arrow.destroy(); arrows.splice(i, 1); continue; } // Check arrow-enemy arrow collisions var arrowDestroyed = false; for (var k = enemyArrows.length - 1; k >= 0; k--) { var enemyArrow = enemyArrows[k]; if (arrow && enemyArrow && arrow.intersects(enemyArrow)) { // Both arrows destroy each other arrow.destroy(); arrows.splice(i, 1); enemyArrow.destroy(); enemyArrows.splice(k, 1); arrowDestroyed = true; break; } } // Skip enemy collision check if arrow was destroyed by enemy arrow if (arrowDestroyed) { continue; } // Check arrow-enemy collisions for (var j = enemies.length - 1; j >= 0; j--) { var enemy = enemies[j]; if (enemy && arrow && arrow.intersects(enemy)) { // Hit enemy - give money instead of points money += 5; kills++; storage.money = money; storage.kills = kills; moneyTxt.setText('Money: ' + money); LK.getSound('hit').play(); LK.effects.flashObject(enemy, 0xff0000, 200); // Remove arrow and enemy arrow.destroy(); arrows.splice(i, 1); enemy.destroy(); enemies.splice(j, 1); break; } } // Check arrow-boss collision if (boss && arrow && arrow.intersects(boss)) { // Hit boss boss.health--; LK.getSound('hit').play(); LK.effects.flashObject(boss, 0xff0000, 300); // Remove arrow arrow.destroy(); arrows.splice(i, 1); // Boss moves to new position when hit boss.moveToNewPosition(); // Check if boss is defeated if (boss.health <= 0) { money += 50; // Bonus money for defeating boss kills += 10; // Count boss as 10 kills storage.money = money; storage.kills = kills; moneyTxt.setText('Money: ' + money); boss.destroy(); boss = null; bossSpawnScore = kills + 20; // Next boss spawns after 20 more kills // Always open shop after boss defeat shopVisible = true; shopContainer.visible = true; // Pause the game when shop opens after boss defeat gamePaused = true; } break; } } // Update enemy arrows for (var m = enemyArrows.length - 1; m >= 0; m--) { var enemyArrow = enemyArrows[m]; // Remove arrows that hit walls or go off screen if (enemyArrow.x >= 2048 || enemyArrow.x <= 0 || enemyArrow.y >= 2732 || enemyArrow.y <= 0) { enemyArrow.destroy(); enemyArrows.splice(m, 1); continue; } // Check if enemy arrow hits player if (enemyArrow.intersects(archer)) { playerHealth--; healthTxt.setText('Health: ' + playerHealth); LK.getSound('playerHit').play(); LK.effects.flashObject(archer, 0xff0000, 300); enemyArrow.destroy(); enemyArrows.splice(m, 1); // Check if player is dead if (playerHealth <= 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } continue; } } // Check if hack mode is active and score exceeds 200 to show HACKER text if (autoBattleActive && LK.getScore() > 200) { // Create red HACKER text if it doesn't exist if (!game.hackerText) { game.hackerText = new Text2('HACKER', { size: 200, fill: 0xff0000 }); game.hackerText.anchor.set(0.5, 0.5); game.hackerText.x = 2048 / 2; game.hackerText.y = 2732 / 2; game.addChild(game.hackerText); // Apply pulsing red glow effect tween(game.hackerText, { alpha: 0.3 }, { duration: 500, easing: tween.easeInOut, onFinish: function onFinish() { tween(game.hackerText, { alpha: 1 }, { duration: 500, easing: tween.easeInOut, onFinish: function onFinish() { // Restart the pulsing effect if (game.hackerText) { tween(game.hackerText, { alpha: 0.3 }, { duration: 500, easing: tween.easeInOut, onFinish: arguments.callee.caller }); } } }); } }); } } else if (game.hackerText) { // Remove HACKER text if conditions not met game.hackerText.destroy(); game.hackerText = null; } // Spawn boss every 20 kills if (boss === null && kills >= bossSpawnScore) { // Clear all existing enemies when boss spawns for (var e = enemies.length - 1; e >= 0; e--) { enemies[e].destroy(); enemies.splice(e, 1); } boss = new Boss(); boss.x = Math.random() * (2048 - 400) + 200; boss.y = Math.random() * (2732 - 400) + 200; // Make sure boss doesn't spawn too close to archer var distToArcher = Math.sqrt(Math.pow(boss.x - archer.x, 2) + Math.pow(boss.y - archer.y, 2)); if (distToArcher < 300) { boss.x = Math.random() * (2048 - 600) + 300; if (boss.x > archer.x - 300 && boss.x < archer.x + 300) { boss.x += 400; } } boss.health = 10; game.addChild(boss); } // When enemy dies, increase max enemies and spawn rate for difficulty if (LK.getScore() > 0 && LK.getScore() % 50 === 0) { if (maxEnemies < 5) { maxEnemies++; } if (enemySpawnRate > 30) { enemySpawnRate -= 5; } } };
===================================================================
--- original.js
+++ change.js
@@ -306,8 +306,23 @@
shopVisible = true;
shopContainer.visible = true;
// Pause the game when shop opens
gamePaused = true;
+ // Clear all enemies when shop opens
+ for (var e = enemies.length - 1; e >= 0; e--) {
+ enemies[e].destroy();
+ enemies.splice(e, 1);
+ }
+ // Clear all enemy arrows when shop opens
+ for (var a = enemyArrows.length - 1; a >= 0; a--) {
+ enemyArrows[a].destroy();
+ enemyArrows.splice(a, 1);
+ }
+ // Clear boss when shop opens
+ if (boss) {
+ boss.destroy();
+ boss = null;
+ }
};
// Add shop event handlers
energyUpgradeBtn.down = function (x, y, obj) {
if (money >= 50) {