modified: js/config.js

modified:   js/entities.js
	modified:   js/ui.js
This commit is contained in:
xbl
2026-02-26 20:40:38 +01:00
parent 657c939d1f
commit 805dd7b082
3 changed files with 28 additions and 24 deletions

View File

@ -36,26 +36,26 @@ var CONFIG = {
COMET_BASE_COST: 1e7, COMET_BASE_COST: 1e7,
PLANET_BASE_COST: 1e24, PLANET_BASE_COST: 1e24,
GIANT_BASE_COST: 1e27, GIANT_BASE_COST: 1e27,
MTYPE_BASE_COST: 1e29, MTYPE_BASE_COST: 1e28,
KTYPE_BASE_COST: 1e30, KTYPE_BASE_COST: 1e29,
GTYPE_BASE_COST: 1e31, GTYPE_BASE_COST: 1e30,
// Upgrade scaling // Upgrade scaling
UPGRADE_COST_MULTIPLIER_ASTER: 1.25, UPGRADE_COST_MULTIPLIER_ASTER: 1.25,
UPGRADE_COST_MULTIPLIER_COMET: 1.5, UPGRADE_COST_MULTIPLIER_COMET: 1.5,
UPGRADE_COST_MULTIPLIER_PLANT: 1.75, UPGRADE_COST_MULTIPLIER_PLANT: 1.75,
UPGRADE_COST_MULTIPLIER_GIANT: 2, UPGRADE_COST_MULTIPLIER_GIANT: 1.875,
UPGRADE_COST_MULTIPLIER_MTYPE: 2.1, UPGRADE_COST_MULTIPLIER_MTYPE: 2,
UPGRADE_COST_MULTIPLIER_KTYPE: 2.2, UPGRADE_COST_MULTIPLIER_KTYPE: 2,
UPGRADE_COST_MULTIPLIER_GTYPE: 2.3, UPGRADE_COST_MULTIPLIER_GTYPE: 2,
UPGRADE_BONUS_PER_LEVEL_ASTER: 0.1, UPGRADE_BONUS_PER_LEVEL_ASTER: 0.1,
UPGRADE_BONUS_PER_LEVEL_COMET: 0.1, UPGRADE_BONUS_PER_LEVEL_COMET: 0.1,
UPGRADE_BONUS_PER_LEVEL_PLANT: 0.05, UPGRADE_BONUS_PER_LEVEL_PLANT: 0.07,
UPGRADE_BONUS_PER_LEVEL_GIANT: 0.03, UPGRADE_BONUS_PER_LEVEL_GIANT: 0.05,
UPGRADE_BONUS_PER_LEVEL_MTYPE: 0.03, UPGRADE_BONUS_PER_LEVEL_MTYPE: 0.09,
UPGRADE_BONUS_PER_LEVEL_KTYPE: 0.03, UPGRADE_BONUS_PER_LEVEL_KTYPE: 0.09,
UPGRADE_BONUS_PER_LEVEL_GTYPE: 0.03, UPGRADE_BONUS_PER_LEVEL_GTYPE: 0.09,
// Asteroid spawn patterns // Asteroid spawn patterns
ASTEROID_SPAWN_PATTERNS: { ASTEROID_SPAWN_PATTERNS: {
@ -72,19 +72,23 @@ var CONFIG = {
giant: [1e26, 1e28], // Gas & Ice Giants giant: [1e26, 1e28], // Gas & Ice Giants
mtype: [1.589e29, 8.95e29],// M-Type: 0.08-0.45 M☉ mtype: [1.589e29, 8.95e29],// M-Type: 0.08-0.45 M☉
ktype: [8.95e29, 1.59e30], // K-Type: 0.45-0.8 M☉ ktype: [8.95e29, 1.59e30], // K-Type: 0.45-0.8 M☉
gtype: [1.59e30, 2.07e30] // K-Type: 0.8-1.04 M☉ gtype: [1.59e30, 2.07e30] // G-Type: 0.8-1.04 M☉
}, },
// Star-tier spawn rate bonuses (applied to all lower tiers)
MTYPE_SPAWN_BOOST_PER_LEVEL: 0.03, // 3% per level
KTYPE_SPAWN_BOOST_PER_LEVEL: 0.04, // 4% per level
GTYPE_SPAWN_BOOST_PER_LEVEL: 0.05, // 5% per level
// Visual Sizes // Visual Sizes
VISUAL_SIZE_SMALL: 1, VISUAL_SIZE_SMALL: 1,
VISUAL_SIZE_MEDIUM: 2, VISUAL_SIZE_MDIUM: 2,
VISUAL_SIZE_LARGE: 3, VISUAL_SIZE_LARGE: 3,
VISUAL_SIZE_COMET: 3, VISUAL_SIZE_COMET: 3,
VISUAL_SIZE_PLANT: 5, VISUAL_SIZE_PLANT: 5,
VISUAL_SIZE_GIANT: 8, VISUAL_SIZE_GIANT: 8,
VISUAL_SIZE_MTYPE: 12, VISUAL_SIZE_MTYPE: 12,
VISUAL_SIZE_KTYPE: 14, VISUAL_SIZE_KTYPE: 13,
VISUAL_SIZE_GTYPE: 16, VISUAL_SIZE_GTYPE: 14,
// Planet color schemes // Planet color schemes
PLANET_COLORS: [ PLANET_COLORS: [

View File

@ -239,7 +239,7 @@ Asteroid.prototype.initializeTypeSpecificProperties = function() {
} else if (this.type === 'large') { } else if (this.type === 'large') {
this.size = CONFIG.VISUAL_SIZE_LARGE + Math.random() * 1; this.size = CONFIG.VISUAL_SIZE_LARGE + Math.random() * 1;
} else if (this.type === 'medium') { } else if (this.type === 'medium') {
this.size = CONFIG.VISUAL_SIZE_MEDIUM + Math.random() * 1; this.size = CONFIG.VISUAL_SIZE_MDIUM + Math.random() * 1;
} else { } else {
this.size = CONFIG.VISUAL_SIZE_SMALL + Math.random() * 1; this.size = CONFIG.VISUAL_SIZE_SMALL + Math.random() * 1;
} }

View File

@ -392,7 +392,7 @@ var UI = {
var rate = (1000 / gameState.currentAsteroidSpawnInterval).toFixed(2); var rate = (1000 / gameState.currentAsteroidSpawnInterval).toFixed(2);
var bonusPercent = (gameState.asteroidUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_ASTER * 100).toFixed(0); var bonusPercent = (gameState.asteroidUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_ASTER * 100).toFixed(0);
var tooltipText = 'Asteroids are rocky, airless bodies that range in size from tiny pebbles to hundreds of kilometers across. Some asteroids have moons or even binary companions.<br><br>Rate: ' + rate + '/sec<br>Bonus: ' + bonusPercent + '%'; var tooltipText = 'Asteroids are rocky, airless bodies that range in size from tiny pebbles to hundreds of kilometers across. Some asteroids have moons or even binary companions.<br><br>Rate: ' + rate + '/sec<br>Bonus: ' + bonusPercent + '%';
if (!gameState.cometUnlocked) tooltipText += '<br>Unlocks Comets at level 20'; if (!gameState.cometUnlocked) tooltipText += '<br><span style="color:#0FF;">Unlocks Comets at level 20</span>';
this.elements.asteroidLevel.innerHTML = '<span class="tooltip-trigger">Asteroids: Level ' + this.elements.asteroidLevel.innerHTML = '<span class="tooltip-trigger">Asteroids: Level ' +
gameState.asteroidUpgradeLevel + gameState.asteroidUpgradeLevel +
@ -409,7 +409,7 @@ var UI = {
var rate = (60000 / gameState.currentCometSpawnInterval).toFixed(2); var rate = (60000 / gameState.currentCometSpawnInterval).toFixed(2);
var bonusPercent = (gameState.cometUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_COMET * 100).toFixed(0); var bonusPercent = (gameState.cometUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_COMET * 100).toFixed(0);
var tooltipText = 'Comets are small icy bodies that typically release gas and dust, forming a glowing coma and often a tail. They are composed mainly of ice, rock, and organic compounds.<br><br>Rate: ' + rate + '/min<br>Bonus: ' + bonusPercent + '%'; var tooltipText = 'Comets are small icy bodies that typically release gas and dust, forming a glowing coma and often a tail. They are composed mainly of ice, rock, and organic compounds.<br><br>Rate: ' + rate + '/min<br>Bonus: ' + bonusPercent + '%';
if (!gameState.planetUnlocked) tooltipText += '<br>Unlocks Planets at level 15'; if (!gameState.planetUnlocked) tooltipText += '<br><span style="color:#0FF;">Unlocks Planets at level 15</span>';
this.elements.cometLevel.innerHTML = '<span class="tooltip-trigger">Comets: Level ' + this.elements.cometLevel.innerHTML = '<span class="tooltip-trigger">Comets: Level ' +
gameState.cometUpgradeLevel + gameState.cometUpgradeLevel +
@ -426,7 +426,7 @@ var UI = {
var rate = (CONFIG.BASE_PLANET_SPAWN_INTERVAL / gameState.currentPlanetSpawnInterval).toFixed(2); var rate = (CONFIG.BASE_PLANET_SPAWN_INTERVAL / gameState.currentPlanetSpawnInterval).toFixed(2);
var bonusPercent = (gameState.planetUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_PLANT * 100).toFixed(0); var bonusPercent = (gameState.planetUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_PLANT * 100).toFixed(0);
var tooltipText = 'Planets are roughly spherical accumulations of rock and metal, with solid surfaces and relatively thin atmospheres. Local examples include Mercury, Earth, and Pluto. They may vary greatly in size.<br><br>Rate: ' + rate + '/hour<br>Bonus: ' + bonusPercent + '%'; var tooltipText = 'Planets are roughly spherical accumulations of rock and metal, with solid surfaces and relatively thin atmospheres. Local examples include Mercury, Earth, and Pluto. They may vary greatly in size.<br><br>Rate: ' + rate + '/hour<br>Bonus: ' + bonusPercent + '%';
if (!gameState.giantUnlocked) tooltipText += '<br>Unlocks Giants at level 10'; if (!gameState.giantUnlocked) tooltipText += '<br><span style="color:#0FF;">Unlocks Giants at level 10</span>';
this.elements.planetLevel.innerHTML = '<span class="tooltip-trigger">Planets: Level ' + this.elements.planetLevel.innerHTML = '<span class="tooltip-trigger">Planets: Level ' +
gameState.planetUpgradeLevel + gameState.planetUpgradeLevel +
@ -442,8 +442,8 @@ var UI = {
updateGiantUpgrade: function(gameState) { updateGiantUpgrade: function(gameState) {
var rate = (CONFIG.BASE_GIANT_SPAWN_INTERVAL / gameState.currentGiantSpawnInterval).toFixed(2); var rate = (CONFIG.BASE_GIANT_SPAWN_INTERVAL / gameState.currentGiantSpawnInterval).toFixed(2);
var bonusPercent = (gameState.giantUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_GIANT * 100).toFixed(0); var bonusPercent = (gameState.giantUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_GIANT * 100).toFixed(0);
var tooltipText = 'Gas giants are large planets made mostly of hydrogen and helium, with thick atmospheres and no solid surface; Jupiter and Saturn are examples.<br>Ice giants are similar but contain higher amounts of frozen materials like water, ammonia, and methane beneath their atmospheres; Uranus and Neptune fall into this category.<br><br>Rate: ' + rate + '/6hours<br>Bonus: ' + bonusPercent + '%'; var tooltipText = 'Gas giants are large planets made mostly of hydrogen and helium, with thick atmospheres and no solid surface.<br>Ice giants are similar but contain higher amounts of frozen materials like water, ammonia, and methane in their atmospheres.<br>Local examples include Jupiter and Neptune.<br><br>Rate: ' + rate + '/6hours<br>Bonus: ' + bonusPercent + '%';
if (!gameState.mtypeUnlocked) tooltipText += '<br>Unlocks M-Type at level 5'; if (!gameState.mtypeUnlocked) tooltipText += '<br><span style="color:#0FF;">Unlocks M-Type at level 5</span>';
this.elements.giantLevel.innerHTML = '<span class="tooltip-trigger">Giants: Level ' + this.elements.giantLevel.innerHTML = '<span class="tooltip-trigger">Giants: Level ' +
gameState.giantUpgradeLevel + gameState.giantUpgradeLevel +
@ -460,7 +460,7 @@ var UI = {
var rate = (CONFIG.BASE_MTYPE_SPAWN_INTERVAL / gameState.currentMtypeSpawnInterval).toFixed(2); var rate = (CONFIG.BASE_MTYPE_SPAWN_INTERVAL / gameState.currentMtypeSpawnInterval).toFixed(2);
var bonusPercent = (gameState.mtypeUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_MTYPE * 100).toFixed(0); var bonusPercent = (gameState.mtypeUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_MTYPE * 100).toFixed(0);
var tooltipText = 'M-types, also known as red dwarfs, are the smallest and coolest stars with masses ranging from about 0.08 to 0.45 M☉.<br>They are the most common star in the universe, making up roughly three quarters of all main-sequence stars, but are not easily visible due to their low luminosity.<br><br>Rate: ' + rate + '/day<br>Bonus: ' + bonusPercent + '%'; var tooltipText = 'M-types, also known as red dwarfs, are the smallest and coolest stars with masses ranging from about 0.08 to 0.45 M☉.<br>They are the most common star in the universe, making up roughly three quarters of all main-sequence stars, but are not easily visible due to their low luminosity.<br><br>Rate: ' + rate + '/day<br>Bonus: ' + bonusPercent + '%';
if (!gameState.ktypeUnlocked) tooltipText += '<br>Unlocks K-Type at level 5'; if (!gameState.ktypeUnlocked) tooltipText += '<br><span style="color:#0FF;">Unlocks K-Type at level 5</span>';
this.elements.mtypeLevel.innerHTML = '<span class="tooltip-trigger">M-Type: Level ' + this.elements.mtypeLevel.innerHTML = '<span class="tooltip-trigger">M-Type: Level ' +
gameState.mtypeUpgradeLevel + gameState.mtypeUpgradeLevel +
@ -475,7 +475,7 @@ var UI = {
var rate = (CONFIG.BASE_KTYPE_SPAWN_INTERVAL / gameState.currentKtypeSpawnInterval).toFixed(2); var rate = (CONFIG.BASE_KTYPE_SPAWN_INTERVAL / gameState.currentKtypeSpawnInterval).toFixed(2);
var bonusPercent = (gameState.ktypeUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_KTYPE * 100).toFixed(0); var bonusPercent = (gameState.ktypeUpgradeLevel * CONFIG.UPGRADE_BONUS_PER_LEVEL_KTYPE * 100).toFixed(0);
var tooltipText = 'K-types, also known as orange dwarfs, are medium-sized stars that are cooler than the Sun, with masses ranging from about 0.45 to 0.8 M☉. They are known for their stability and long lifespans (20 to 70 billion years), making them potential candidates for supporting inhabited planets.<br><br>Rate: ' + rate + '/2days<br>Bonus: ' + bonusPercent + '%'; var tooltipText = 'K-types, also known as orange dwarfs, are medium-sized stars that are cooler than the Sun, with masses ranging from about 0.45 to 0.8 M☉. They are known for their stability and long lifespans (20 to 70 billion years), making them potential candidates for supporting inhabited planets.<br><br>Rate: ' + rate + '/2days<br>Bonus: ' + bonusPercent + '%';
if (!gameState.gtypeUnlocked) tooltipText += '<br>Unlocks G-Type at level 5'; if (!gameState.gtypeUnlocked) tooltipText += '<br><span style="color:#0FF;">Unlocks G-Type at level 5</span>';
this.elements.ktypeLevel.innerHTML = '<span class="tooltip-trigger">K-Type: Level ' + this.elements.ktypeLevel.innerHTML = '<span class="tooltip-trigger">K-Type: Level ' +
gameState.ktypeUpgradeLevel + gameState.ktypeUpgradeLevel +