add terrain to map

This commit is contained in:
evanpelle
2024-08-30 22:01:08 -07:00
parent 6aacffc27d
commit 8b2c2a13c0
8 changed files with 133 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import {Cell} from './Game';
import binAsString from "!!binary-loader!../../resources/World.bin";
import binAsString from "!!binary-loader!../../resources/TopoWorldMap.bin";
export class TerrainMap {
constructor(public readonly tiles: Terrain[][]) { }
+1 -1
View File
@@ -16,7 +16,7 @@ export const devConfig = new class extends DefaultConfig {
}
numBots(): number {
return 250
return 0
}
startTroops(playerInfo: PlayerInfo): number {
+5 -1
View File
@@ -90,7 +90,11 @@ export const pastelTheme = new class implements Theme {
if (tile.isShore()) {
return this.shore
}
return this.land;
return colord({
r: 174 + 5 * tile.magnitude(),
g: 163 + 5 * tile.magnitude(),
b: 128 + 5 * tile.magnitude()
})
} else {
const w = this.water.rgba
if (tile.isShorelineWater()) {
+3
View File
@@ -80,6 +80,9 @@ export class PlayerExecution implements Execution {
const tiles = bfs(firstTile, filter)
const modePlayer = this.mg.player(mode)
if (modePlayer == null) {
console.warn('mode player is null')
}
for (const tile of tiles) {
modePlayer.conquer(tile)
}