NPCs create battleships, destroyers. start work on miniastar

This commit is contained in:
Evan
2024-11-30 12:41:22 -08:00
parent 5d4befb117
commit 30f72a3365
11 changed files with 221 additions and 55 deletions
+2 -20
View File
@@ -15,30 +15,12 @@ interface Coord {
y: number;
}
export class TerrainMap {
constructor(public readonly tiles: Terrain[][]) { }
terrain(coord: Coord): Terrain {
return this.tiles[coord.x][coord.y]
}
width(): number {
return this.tiles.length
}
height(): number {
return this.tiles[0].length
}
}
export enum TerrainType {
enum TerrainType {
Land,
Water
}
export class Terrain {
class Terrain {
public shoreline: boolean = false
public magnitude: number = 0
public ocean: boolean