diff --git a/TODO.txt b/TODO.txt index 559617ff1..2a9294a00 100644 --- a/TODO.txt +++ b/TODO.txt @@ -49,7 +49,7 @@ * show bar for long to respawn DONE 8/26/2024 * store & delay tile updates for lag compensation DONE 8/26/2024 * BUG: error if don't spawn and then click after spawn mode DONE 8/26/2024 -* BUG: change player name after join lobby +* BUG: change player name after join lobby DONE 8/26/2024 * REFACTOR: use new priority queue * BUG: players attack each other same time creates islands * add shader to dim border @@ -60,4 +60,5 @@ * PERF: use hierarchical a* search for boats * PERF: render tiles more efficiently * Add terrain elevation to map -* boats can go around the world \ No newline at end of file +* boats can go around the world +* make bots more likely to attack weaker players \ No newline at end of file diff --git a/resources/images/PastelMap.png b/resources/images/PastelMap.png new file mode 100644 index 000000000..5b590e712 Binary files /dev/null and b/resources/images/PastelMap.png differ diff --git a/src/client/Client.ts b/src/client/Client.ts index abd9c5a0a..01d5d0b4e 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -5,8 +5,7 @@ import {PseudoRandom} from "../core/PseudoRandom"; import {GameID, Lobby, ServerMessage, ServerMessageSchema} from "../core/Schemas"; import {loadTerrainMap, TerrainMap} from "../core/TerrainMapLoader"; import {ClientGame, createClientGame} from "./ClientGame"; -import {v4 as uuidv4} from 'uuid'; -import backgroundImage from '../../resources/images/VintageMap2.png'; +import backgroundImage from '../../resources/images/PastelMap.png'; import favicon from '../../resources/images/Favicon.png'; import './styles.css'; diff --git a/src/client/graphics/GameRenderer.ts b/src/client/graphics/GameRenderer.ts index e9cda3fd6..34e0f47f5 100644 --- a/src/client/graphics/GameRenderer.ts +++ b/src/client/graphics/GameRenderer.ts @@ -6,7 +6,7 @@ import {NameRenderer} from "./NameRenderer"; import {bfs, manhattanDist} from "../../core/Util"; import {PseudoRandom} from "../../core/PseudoRandom"; import {TerrainRenderer} from "./TerrainRenderer"; -import {MaxPriorityQueue, PriorityQueue} from "@datastructures-js/priority-queue"; +import {PriorityQueue} from "@datastructures-js/priority-queue"; export class GameRenderer { private territoryCanvas: HTMLCanvasElement @@ -20,16 +20,13 @@ export class GameRenderer { private context: CanvasRenderingContext2D - private nameRenderer: NameRenderer; private theme: Theme private random = new PseudoRandom(123) - private tileToRenderQueue: PriorityQueue<{tileEvent: TileEvent, lastUpdate: number}> = new PriorityQueue((a, b) => {return a.lastUpdate - b.lastUpdate}) - constructor(private gs: Game, private terrainRenderer: TerrainRenderer) { this.theme = gs.config().theme() this.nameRenderer = new NameRenderer(gs, this.theme) @@ -70,13 +67,10 @@ export class GameRenderer { } renderGame() { - // Clear the canvas - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0, 0, this.gs.width(), this.gs.height()); // Set background this.context.fillStyle = this.theme.backgroundColor().toHex(); - this.context.fillRect(0, 0, this.gs.width(), this.gs.height()); + this.context.fillRect(0, 0, this.canvas.width, this.canvas.height); // Save the current context state this.context.save(); diff --git a/src/client/index.html b/src/client/index.html index b1cdc8c0a..a02fcf42f 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -10,6 +10,7 @@

OpenFront.io

+

(v0.01)

@@ -20,7 +21,7 @@
-
+