Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'initialSpawn is not defined' in or related to this line: 'initialSpawn();' Line Number: 778
User prompt
Please fix the bug: 'ReferenceError: quantumSelectionActive is not defined' in or related to this line: 'if (quantumSelectionActive) {' Line Number: 746
User prompt
Please fix the bug: 'ReferenceError: upgradeMenu is not defined' in or related to this line: 'if (upgradeMenu.parent) {' Line Number: 733
User prompt
Please fix the bug: 'ReferenceError: droneObjects is not defined' in or related to this line: 'for (var i = 0; i < droneObjects.length; i++) {' Line Number: 715
User prompt
Please fix the bug: 'ReferenceError: clusters is not defined' in or related to this line: 'clusters.forEach(function (c) {' Line Number: 167
User prompt
Please fix the bug: 'updateUI is not defined' in or related to this line: 'updateUI();' Line Number: 783
User prompt
Please fix the bug: 'initialSpawn is not defined' in or related to this line: 'initialSpawn();' Line Number: 778
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'elapsed')' in or related to this line: 'self.y += Math.sin(LK.time.elapsed / 250) * 0.5;' Line Number: 262
User prompt
var Drone = Container.expand(function () { var self = Container.call(this); // Attach the drone sprite self.droneSprite = LK.getAsset('drone_asset', { anchorX: 0.5, anchorY: 0.5 }); self.addChild(self.droneSprite); // Movement self.vx = (Math.random() - 0.5) * 6; // random velocity x self.vy = (Math.random() - 0.5) * 6; // random velocity y self.speed = 3; self.changeDirCounter = 0; // how many frames until we pick new direction // AoE stats self.AOE_RANGE = 100; self.droneDamage = 2; // how much damage each zap deals (tweak as needed) self.cooldown = 0; // frames self.COOLDOWN_MAX = 60; // 1 second if your game is ~60fps self.updateDrone = function () { // 1) Movement if (self.changeDirCounter <= 0) { // pick new random direction occasionally self.vx = (Math.random() - 0.5) * self.speed; self.vy = (Math.random() - 0.5) * self.speed; self.changeDirCounter = 120; // every 2s } else { self.changeDirCounter--; } // update position self.x += self.vx; self.y += self.vy; // bounce off edges (assuming 2048x2732 stage) if (self.x < 50 || self.x > 2000) self.vx *= -1; if (self.y < 50 || self.y > 2682) self.vy *= -1; // 2) AoE Zap if cooldown is ready if (self.cooldown > 0) { self.cooldown--; } else { self.tryZap(); } }; self.tryZap = function () { // Find any ore within AOE_RANGE // We'll gather a list of clusters or single ores within range var anyHit = false; clusters.forEach(function (cluster) { cluster.oreList.forEach(function (ore) { if (ore.health > 0) { var oreGlobalX = cluster.x + ore.x; var oreGlobalY = cluster.y + ore.y; var dx = self.x - oreGlobalX; var dy = self.y - oreGlobalY; var dist = Math.sqrt(dx*dx + dy*dy); if (dist < self.AOE_RANGE) { // deal damage ore.health -= self.droneDamage; anyHit = true; if (ore.health <= 0) { var baseValue = ore.getValue(); gameState.money += baseValue; updateUI(); ore.cluster.notifyOreDestroyed(ore); spawnMiningParticles(ore, 5); } } } }); }); // If we zapped anything, apply cooldown if (anyHit) { self.cooldown = self.COOLDOWN_MAX; } }; return self; }); game.update = function () { // existing miner update if (miner) miner.update(); // your other logic (clusters, etc.) // update each drone for (var i = 0; i < droneObjects.length; i++) { droneObjects[i].updateDrone(); } }; { id: 'drone_level_1', name: 'Buy Drones (Lv +1)', cost: 5000, effect: 'Each level adds another drone that roams & AoE zaps', purchased: false, multi: true, level: 0, action: function () { if (!gameState.droneLevel) gameState.droneLevel = 0; gameState.droneLevel++; this.level++; this.cost = Math.floor(this.cost * 1.5); updateDroneObjects(); } } var droneObjects = []; // A function to create new drones up to gameState.droneLevel function updateDroneObjects() { // If we want exactly gameState.droneLevel drones: while (droneObjects.length < gameState.droneLevel) { var d = new Drone(); // position them randomly d.x = 200 + Math.random() * (2048 - 400); d.y = 200 + Math.random() * (2732 - 400); droneObjects.push(d); game.addChild(d); } }
User prompt
// Make sure to call updateDroneSprites() after you buy or increase drone level: { // inside the 'drone_level_1' upgrade or anywhere you increment droneLevel: action: function () { gameState.droneLevel++; this.level++; this.cost = Math.floor(this.cost * 1.5); updateDroneSprites(); } }
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'elapsed')' in or related to this line: 'if (LK.time.elapsed % 60 === 0) {' Line Number: 1332
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'p.x = ore.parent.x + ore.x;' Line Number: 336
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'p.x = ore.parent.x + ore.x;' Line Number: 294
Code edit (1 edits merged)
Please save this source code
User prompt
Fix it
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'ref.textObj.style.fill = 0x666666;' Line Number: 638
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'ref.textObj.style.fill = 0x666666;' Line Number: 637
User prompt
Please fix the bug: 'TypeError: setTimeout is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 75
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'p.lastX = ore.parent.x + ore.x;' Line Number: 317
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'p.x = ore.parent.x + ore.x;' Line Number: 317
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ /**** * CLASSES ****/ /** * A cluster container that spawns several Ore objects of the same type. * We track how many remain. Once all are destroyed, we remove the cluster * and eventually spawn a new one (after a delay). */ var Cluster = Container.expand(function (type) { var self = Container.call(this); self.type = type; self.oreList = []; // Random center var centerX = 100 + Math.random() * (2048 - 200); var centerY = 100 + Math.random() * (2732 - 200); self.x = centerX; self.y = centerY; // Decide how many ore are in this cluster var clusterConfig = gameState.clusterConfig; var count = randomInt(clusterConfig.min, clusterConfig.max); // Create each ore with random offsets for (var i = 0; i < count; i++) { var ore = new Ore(type, self); ore.x = (Math.random() - 0.5) * 120; ore.y = (Math.random() - 0.5) * 120; self.oreList.push(ore); self.addChild(ore); } self.notifyOreDestroyed = function (ore) { if (self.oreList.indexOf(ore) >= 0) { self.oreList.splice(self.oreList.indexOf(ore), 1); } ore.destroy(); // If all gone => cluster done if (self.oreList.length === 0) { if (self.parent) { self.parent.removeChild(self); } var idx = clusters.indexOf(self); if (idx >= 0) { clusters.splice(idx, 1); } // Decrement cluster count gameState.clusterCount[self.type]--; // Wait, then spawn new cluster if not max var finalDelay = gameState.respawnTime; if (self.type === 'coal') { finalDelay *= 2; // slower for coal } LK.setTimeout(function () { maybeSpawnCluster(self.type); }, finalDelay); } }; return self; }); /** * Miner class: moves to the closest available ore (within currentTier) and mines it. */ var Miner = Container.expand(function () { var self = Container.call(this); self.attachAsset('miner', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.currentTarget = null; self.miningRange = 25; self.miningCooldown = 0; self.miningRate = 30; self.miningDamage = 1; // findNewTarget picks from ALL clusters' ore, sorted by distance self.findNewTarget = function () { var validOre = []; clusters.forEach(function (c) { c.oreList.forEach(function (ore) { // only if alive and within tier if (ore.health > 0 && ore.tier <= gameState.currentTier) { validOre.push(ore); } }); }); if (validOre.length === 0) { self.currentTarget = null; return; } // global coords self.currentTarget = validOre.sort(function (a, b) { var aX = a.parent.x + a.x; var aY = a.parent.y + a.y; var bX = b.parent.x + b.x; var bY = b.parent.y + b.y; var distA = Math.hypot(aX - self.x, aY - self.y); var distB = Math.hypot(bX - self.x, bY - self.y); return distA - distB; })[0]; }; self.update = function () { self.findNewTarget(); if (self.currentTarget) { var tx = self.currentTarget.parent.x + self.currentTarget.x; var ty = self.currentTarget.parent.y + self.currentTarget.y; var dx = tx - self.x; var dy = ty - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.miningRange) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } else { self.mineOre(self.currentTarget); } } else { // idle float self.y += Math.sin(LK.time.elapsed / 250) * 0.5; } }; self.mineOre = function (ore) { if (self.miningCooldown > 0) { self.miningCooldown--; return; } ore.health -= self.miningDamage * gameState.pickaxeLevel; self.miningCooldown = self.miningRate; if (ore.health <= 0) { gameState.money += ore.getValue(); updateUI(); ore.cluster.notifyOreDestroyed(ore); spawnMiningParticles(ore, 5); } else { spawnMiningParticles(ore, 2); } }; return self; }); /** * A single ore object. */ var Ore = Container.expand(function (type, cluster) { var self = Container.call(this); self.type = type; self.cluster = cluster; // Tier self.tier = ['coal', 'iron', 'gold', 'diamond'].indexOf(type) + 1; self.maxHealth = 10; self.health = self.maxHealth; self.baseValue = 5 * self.tier; // base money self.attachAsset(type + '_ore', { anchorX: 0.5, anchorY: 0.5 }); // health bar: 120×20 self.healthBar = LK.getAsset('rectangle', { width: 120, height: 20, fill: 0x00FF00, anchorX: 0.5, anchorY: 0.5 }); self.healthBar.x = 0; self.healthBar.y = -70; self.addChild(self.healthBar); self.getValue = function () { return self.baseValue * gameState.oreMultipliers[self.type]; }; return self; }); /**** * Initialize Game ****/ /**** * HELPER / UTILITY FUNCTIONS ****/ /**** * THE GAME ****/ var game = new LK.Game({ backgroundColor: 0x1a1a1a }); /**** * Game Code ****/ /**** * GLOBAL ARRAYS & STATE ****/ /**** * PLUGINS ****/ // NEW asset for opening the shop: // Existing assets /**** * ASSETS ****/ // The Miner var clusters = []; // containers for each "cluster" of ore var gameState = { money: 0, pickaxeLevel: 1, currentTier: 1, oreMultipliers: { coal: 1, iron: 1, gold: 1, diamond: 1 }, // Respawn timing (in ms) respawnTime: 3000, // Max # of clusters per type maxClustersPerType: 3, // Currently existing cluster count by type clusterCount: { coal: 0, iron: 0, gold: 0, diamond: 0 }, // Config for cluster sizes clusterConfigLevels: [{ min: 2, max: 3 }, // default { min: 2, max: 4 }, { min: 3, max: 5 }, { min: 5, max: 10 }], clusterUpgradeTier: 0, get clusterConfig() { // e.g. clusterConfigLevels[0] => 2-3 return this.clusterConfigLevels[this.clusterUpgradeTier] || { min: 2, max: 3 }; } }; /**** * HELPER / UTILITY FUNCTIONS ****/ function maybeSpawnCluster(type) { var tIndex = ['coal', 'iron', 'gold', 'diamond'].indexOf(type) + 1; if (tIndex > gameState.currentTier) { return; } if (gameState.clusterCount[type] >= gameState.maxClustersPerType) { return; } var cluster = new Cluster(type); game.addChild(cluster); clusters.push(cluster); gameState.clusterCount[type]++; } // random int in [min, max] function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } // spawn mining particles function spawnMiningParticles(ore, num) { for (var i = 0; i < num; i++) { var p = LK.getAsset('mining_particle', { anchorX: 0.5, anchorY: 0.5 }); if (ore.parent) { p.x = ore.parent.x + ore.x; p.y = ore.parent.y + ore.y; } p.vx = (Math.random() - 0.5) * 10; p.vy = (Math.random() - 0.5) * 10; p.alpha = 1; tween(p, { alpha: 0, y: p.y - 50 }, { duration: 1000, onFinish: function onFinish() { p.destroy(); } }); game.addChild(p); } } // color interpolation function interpolateColor(color1, color2, factor) { var r1 = color1 >> 16 & 0xff; var g1 = color1 >> 8 & 0xff; var b1 = color1 & 0xff; var r2 = color2 >> 16 & 0xff; var g2 = color2 >> 8 & 0xff; var b2 = color2 & 0xff; var r = Math.round(r1 + factor * (r2 - r1)); var g = Math.round(g1 + factor * (g2 - g1)); var b = Math.round(b1 + factor * (b2 - b1)); return r << 16 | g << 8 | b; } var miner = game.addChild(new Miner()); miner.x = 2048 / 2; miner.y = 2732 / 2; // Background var background = LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5 }); background.x = 2048 / 2; background.y = 2732 / 2; game.addChildAt(background, 0); /**** * UI ****/ var upgradeMenu = new Container(); var tooltip = new Text2('', { size: 40, fill: 0xFFFFFF }); var moneyDisplay = new Text2('$0', { size: 80, fill: 0xFFFFFF, fontWeight: 'bold', stroke: 0x000000, strokeThickness: 5 }); moneyDisplay.x = 2048 / 2 - moneyDisplay.width / 2; moneyDisplay.y = 50; game.addChild(moneyDisplay); var shopOpenButton = LK.getAsset('shop_icon', { // new asset anchorX: 0.5, anchorY: 0.5 }); shopOpenButton.x = 2048 - 150; shopOpenButton.y = 2732 - 150; shopOpenButton.down = function () { createMainUpgradeMenu(); game.addChild(upgradeMenu); }; game.addChild(shopOpenButton); // Debug: Add money button (bottom left) var addMoneyButton = LK.getAsset('buy_button', { anchorX: 0.5, anchorY: 0.5 }); addMoneyButton.x = 200; addMoneyButton.y = 2732 - 150; addMoneyButton.down = function () { gameState.money += 50000; updateUI(); }; game.addChild(addMoneyButton); game.addChild(tooltip); /**** * UPGRADE SYSTEM ****/ // We split upgrades by category for our new sub-menu system var coalUpgrades = [{ id: 'coal_expert', name: "Coal Expertise", cost: 100, multi: true, level: 0, effect: "Doubles coal value each purchase", action: function action() { this.level++; gameState.oreMultipliers.coal *= 2; this.cost *= 2; } }]; var ironUpgrades = [{ id: 'unlock_iron', name: "Unlock Iron Mining", cost: 500, effect: "Allows iron ore clusters to spawn", purchased: false, action: function action() { gameState.currentTier = Math.max(gameState.currentTier, 2); // Immediately spawn iron clusters for (var i = 0; i < gameState.maxClustersPerType; i++) { maybeSpawnCluster('iron'); } } }, { id: 'iron_expert', name: "Iron Expertise", cost: 2000, effect: "Triple iron value", requires: 'unlock_iron', purchased: false, action: function action() { gameState.oreMultipliers.iron *= 3; } }]; var goldUpgrades = [{ id: 'unlock_gold', name: "Unlock Gold Mining", cost: 5000, effect: "Allows gold ore clusters to spawn", action: function action() { gameState.currentTier = Math.max(gameState.currentTier, 3); // Immediately spawn gold for (var i = 0; i < gameState.maxClustersPerType; i++) { maybeSpawnCluster('gold'); } } }, { id: 'gold_expert', name: "Gold Expertise", cost: 10000, effect: "Quadruple gold value", requires: 'unlock_gold', action: function action() { gameState.oreMultipliers.gold *= 4; } }]; var diamondUpgrades = [{ id: 'unlock_diamond', name: "Unlock Diamond Mining", cost: 20000, effect: "Allows diamond ore clusters to spawn", action: function action() { gameState.currentTier = Math.max(gameState.currentTier, 4); // Immediately spawn diamond for (var i = 0; i < gameState.maxClustersPerType; i++) { maybeSpawnCluster('diamond'); } } }]; var generalUpgrades = [{ id: 'faster_respawn', name: "Quicker Respawn", cost: 8000, effect: "Halves respawn time (min 500 ms)", action: function action() { gameState.respawnTime = Math.max(500, gameState.respawnTime / 2); } }, { id: 'cluster_up', name: "Cluster Growth", cost: 1000, effect: "Increase cluster size range", purchased: false, action: function action() { if (gameState.clusterUpgradeTier < gameState.clusterConfigLevels.length - 1) { gameState.clusterUpgradeTier++; } this.cost += 2000; } }]; // We can define a quick "requires" check function function meetsRequirement(upgList, upg) { if (!upg.requires) { return true; } // if upg requires 'xxx', find that upgrade in the same category var needed = upgList.find(function (u) { return u.id === upg.requires; }); return needed && needed.purchased; } /**** * MAIN MENU: 5 categories ****/ function createMainUpgradeMenu() { upgradeMenu.removeChildren(); // Big background var menuBg = LK.getAsset('rectangle', { width: 1800, height: 2000, color: 0x2a2a2a, anchorX: 0.5, anchorY: 0.5 }); menuBg.x = 2048 / 2; // shift down slightly menuBg.y = 2732 / 2 + 50; upgradeMenu.addChild(menuBg); // We'll create 5 buttons for categories: Coal, Iron, Gold, Diamond, General var categories = [{ name: "Coal Upgrades", yOff: -600, onClick: function onClick() { createSubUpgradeMenu("Coal Upgrades", coalUpgrades); } }, { name: "Iron Upgrades", yOff: -300, onClick: function onClick() { createSubUpgradeMenu("Iron Upgrades", ironUpgrades); } }, { name: "Gold Upgrades", yOff: 0, onClick: function onClick() { createSubUpgradeMenu("Gold Upgrades", goldUpgrades); } }, { name: "Diamond Upgrades", yOff: 300, onClick: function onClick() { createSubUpgradeMenu("Diamond Upgrades", diamondUpgrades); } }, { name: "General Upgrades", yOff: 600, onClick: function onClick() { createSubUpgradeMenu("General Upgrades", generalUpgrades); } }]; var centerX = menuBg.x; var centerY = menuBg.y; categories.forEach(function (cat) { var btn = LK.getAsset('buy_button', { anchorX: 0.5, anchorY: 0.5 }); btn.x = centerX; btn.y = centerY + cat.yOff; btn.down = cat.onClick; upgradeMenu.addChild(btn); var txt = new Text2(cat.name, { size: 50, fill: 0xFFFFFF, align: 'center' }); txt.anchor.set(0.5); txt.x = btn.x; txt.y = btn.y; upgradeMenu.addChild(txt); }); // Close button var closeBtn = LK.getAsset('cancelButton', { anchorX: 0.5, anchorY: 0.5 }); closeBtn.x = menuBg.x + 700; closeBtn.y = menuBg.y - 800; closeBtn.down = function () { game.removeChild(upgradeMenu); }; upgradeMenu.addChild(closeBtn); } /**** * SUB MENU for a given category of upgrades ****/ var subUpgradeItemRefs = []; // track references to update color in real-time function createSubUpgradeMenu(title, upgList) { upgradeMenu.removeChildren(); subUpgradeItemRefs = []; // Big background var menuBg = LK.getAsset('rectangle', { width: 1800, height: 2000, color: 0x2a2a2a, anchorX: 0.5, anchorY: 0.5 }); menuBg.x = 2048 / 2; menuBg.y = 2732 / 2 + 50; upgradeMenu.addChild(menuBg); // Title var titleText = new Text2(title, { size: 60, fill: 0xFFFFFF, align: 'center' }); titleText.anchor.set(0.5); titleText.x = menuBg.x; titleText.y = menuBg.y - 850; upgradeMenu.addChild(titleText); // Layout the upgrades in a single column // We'll do ~150px vertical spacing between items var startY = menuBg.y - 650; upgList.forEach(function (upg, i) { // Container for button + text var c = new Container(); upgradeMenu.addChild(c); var btn = LK.getAsset('buy_button', { anchorX: 0.5, anchorY: 0.5 }); btn.x = menuBg.x; btn.y = startY + i * 150; c.addChild(btn); // Display name var displayName = upg.name; if (upg.level && upg.level > 0) { displayName += " (Lv " + upg.level + ")"; } var txtStr = displayName + "\n" + upg.effect + "\n$" + upg.cost; var txt = new Text2(txtStr, { size: 40, fill: 0x666666, align: 'center' }); txt.anchor.set(0.5); txt.x = btn.x; txt.y = btn.y; c.addChild(txt); btn.down = function () { var canBuy = checkSubUpgradeBuyable(upgList, upg); if (canBuy) { gameState.money -= upg.cost; upg.purchased = true; // Mark purchased upg.action(); updateUI(); // Refresh sub-menu so cost, text, etc. updates createSubUpgradeMenu(title, upgList); } }; subUpgradeItemRefs.push({ upgrade: upg, upgradesList: upgList, textObj: txt }); }); // Back button var backBtn = LK.getAsset('cancelButton', { anchorX: 0.5, anchorY: 0.5 }); backBtn.x = menuBg.x + 700; backBtn.y = menuBg.y - 800; backBtn.down = function () { createMainUpgradeMenu(); }; upgradeMenu.addChild(backBtn); } // Helper to see if we can buy an upgrade in a sub-menu function checkSubUpgradeBuyable(upgList, upg) { // If we have a "requires" that isn't purchased, can't buy if (!meetsRequirement(upgList, upg)) { return false; } // If it's multi: we do not block further purchases. // If not multi & purchased => no if (!upg.multi && upg.purchased) { return false; } if (gameState.money < upg.cost) { return false; } return true; } // Also re-check color each frame /**** * MAIN GAME LOOP: updating the buy menu text colors ****/ game.update = function () { // 1) Miner logic miner.update(); // 2) Update ore visuals clusters.forEach(function (cluster) { cluster.oreList.forEach(function (ore) { if (ore.health > 0) { var fraction = ore.health / ore.maxHealth; ore.healthBar.width = 120 * fraction; ore.healthBar.fill = interpolateColor(0xFF0000, 0x00FF00, fraction); ore.alpha = fraction; } }); }); // 3) If a sub-menu is open, re-check color if (upgradeMenu.parent) { subUpgradeItemRefs.forEach(function (ref) { var upg = ref.upgrade; var canBuy = checkSubUpgradeBuyable(ref.upgradesList, upg); if (ref.textObj && ref.textObj.style) { ref.textObj.style.fill = canBuy ? 0xFFFFFF : 0x666666; } }); } }; /**** * UI UPDATE ****/ function updateUI() { moneyDisplay.setText("$" + gameState.money.toLocaleString() + "\n" + "Multipliers: " + "C" + gameState.oreMultipliers.coal + "x " + "I" + gameState.oreMultipliers.iron + "x " + "G" + gameState.oreMultipliers.gold + "x " + "D" + gameState.oreMultipliers.diamond + "x"); moneyDisplay.x = 2048 / 2 - moneyDisplay.width / 2; } /**** * SAVE & LOAD ****/ LK.saveGame = function () { return gameState; }; LK.loadGame = function (data) { gameState = data; updateUI(); }; /**** * INITIAL SPAWN * Spawn up to maxClusters for each ore up to currentTier ****/ function initialSpawn() { var oreTypes = ['coal', 'iron', 'gold', 'diamond']; oreTypes.forEach(function (type, idx) { var tier = idx + 1; if (tier <= gameState.currentTier) { for (var i = 0; i < gameState.maxClustersPerType; i++) { maybeSpawnCluster(type); } } }); } initialSpawn(); updateUI();
===================================================================
--- original.js
+++ change.js
@@ -274,10 +274,12 @@
var p = LK.getAsset('mining_particle', {
anchorX: 0.5,
anchorY: 0.5
});
- p.x = ore.parent.x + ore.x;
- p.y = ore.parent.y + ore.y;
+ if (ore.parent) {
+ p.x = ore.parent.x + ore.x;
+ p.y = ore.parent.y + ore.y;
+ }
p.vx = (Math.random() - 0.5) * 10;
p.vy = (Math.random() - 0.5) * 10;
p.alpha = 1;
tween(p, {
drone_shot
Sound effect
mine_coal
Sound effect
mine_iron
Sound effect
mine_gold
Sound effect
mine_diamond
Sound effect
mine_sapphire
Sound effect
mine_emerald
Sound effect
mine_ruby
Sound effect
mine_chronostone
Sound effect
mine_quantumshard
Sound effect
ore_destroy_coal
Sound effect
ore_destroy_iron
Sound effect
ore_destroy_gold
Sound effect
ore_destroy_diamond
Sound effect
ore_destroy_sapphire
Sound effect
ore_destroy_emerald
Sound effect
ore_destroy_ruby
Sound effect
mine_coal_1
Sound effect
mine_coal_2
Sound effect
mine_coal_3
Sound effect
mine_diamond1
Sound effect
mine_diamond2
Sound effect
mine_diamond3
Sound effect
mine_emerald1
Sound effect
mine_emerald2
Sound effect
mine_emerald3
Sound effect
mine_gold1
Sound effect
mine_gold2
Sound effect
mine_gold3
Sound effect
mine_iron1
Sound effect
mine_iron2
Sound effect
mine_iron3
Sound effect
mine_ruby1
Sound effect
mine_ruby2
Sound effect
mine_ruby3
Sound effect
mine_sapphire1
Sound effect
mine_sapphire2
Sound effect
mine_sapphire3
Sound effect
song1
Music
song2
Music
song3
Music
song4
Music
song5
Music
song6
Music
song7
Music
song8
Music
song9
Music
song10
Music
song11
Music
song12
Music
song1a
Music
song1b
Music
song2a
Music
song2b
Music
song3a
Music
song3b
Music
song4a
Music
song4b
Music
song5a
Music
song5b
Music
song6a
Music
song6b
Music
song7a
Music
song7b
Music
song8a
Music
song8b
Music
song9a
Music
song9b
Music
song10a
Music
song10b
Music
song11a
Music
song11b
Music
song12a
Music
song12b
Music