diff --git a/TODO.txt b/TODO.txt index 29bbf873f..8145ecd7f 100644 --- a/TODO.txt +++ b/TODO.txt @@ -88,9 +88,9 @@ --- v2 Release * put number of troops ui DONE 9/3/2024 +* names don't appear when zoomed out DONE 9/3/2024 +* make names bigger DONE 9/3/2024 * boats leave trails -* names don't appear when zoomed out -* make names bigger * send boat even if touching * directed expansion * more random names for game id & client id diff --git a/src/client/graphics/NameBoxCalculator.ts b/src/client/graphics/NameBoxCalculator.ts index 5c3d2399c..1f0720c75 100644 --- a/src/client/graphics/NameBoxCalculator.ts +++ b/src/client/graphics/NameBoxCalculator.ts @@ -130,6 +130,6 @@ export function largestRectangleInHistogram(widths: number[]): Rectangle { export function calculateFontSize(rectangle: Rectangle, name: string): number { // This is a simplified calculation. You might want to adjust it based on your specific font and rendering system. const widthConstrained = rectangle.width / name.length; - const heightConstrained = rectangle.height / name.length; + const heightConstrained = rectangle.height / 3; return Math.min(widthConstrained, heightConstrained); } \ No newline at end of file diff --git a/src/client/graphics/NameRenderer.ts b/src/client/graphics/NameRenderer.ts index c0bdb8c66..eb84eaed1 100644 --- a/src/client/graphics/NameRenderer.ts +++ b/src/client/graphics/NameRenderer.ts @@ -86,11 +86,11 @@ export class NameRenderer { isVisible(render: RenderInfo, min: Cell, max: Cell): boolean { const ratio = (max.x - min.x) / Math.max(20, (render.boundingBox.max.x - render.boundingBox.min.x)) if (render.player.isBot()) { - if (ratio > 25) { + if (ratio > 35) { return false } } else { - if (ratio > 30) { + if (ratio > 35) { return false } } @@ -124,7 +124,7 @@ export class NameRenderer { context.fillText(render.player.name(), nameCenterX, nameCenterY - render.fontSize / 2); context.font = `bold ${render.fontSize}px ${this.theme.font()}`; - + context.fillText(renderTroops(render.player.troops()), nameCenterX, nameCenterY + render.fontSize); } } \ No newline at end of file diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index 1a59512eb..7e952596c 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -26,12 +26,12 @@ export const devConfig = new class extends DefaultConfig { return 5000 } - troopAdditionRate(player: Player): number { - let max = Math.sqrt(player.numTilesOwned()) * 2000 + 10000 + 10000 - max = Math.min(max, 1_000_000) + // troopAdditionRate(player: Player): number { + // let max = Math.sqrt(player.numTilesOwned()) * 2000 + 10000 + 10000 + // max = Math.min(max, 1_000_000) - let toAdd = 10 + (player.troops() + Math.sqrt(player.troops() * player.numTilesOwned())) / 200 * 100 + // let toAdd = 10 + (player.troops() + Math.sqrt(player.troops() * player.numTilesOwned())) / 200 * 100 - return Math.min(player.troops() + toAdd, max) - } + // return Math.min(player.troops() + toAdd, max) + // } } \ No newline at end of file