trying to build protos

This commit is contained in:
evanpelle
2024-08-20 08:11:41 -07:00
parent 95133007c2
commit 8bd86d0384
11 changed files with 1461 additions and 16 deletions
+3
View File
@@ -2,6 +2,8 @@ import {Jimp as JimpType, JimpConstructors} from '@jimp/core';
import 'jimp';
import {TerrainMap, TerrainType, TerrainTypes} from './Game';
import {TerrainMapImpl} from './GameImpl';
import {TerrainTile} from '../../generated/protos';
declare const Jimp: JimpType & JimpConstructors;
@@ -14,6 +16,7 @@ export async function loadTerrainMap(): Promise<TerrainMap> {
const terrain: TerrainType[][] = Array(width).fill(null).map(() => Array(height).fill(TerrainTypes.Water));
image.scan(0, 0, width, height, function (x: number, y: number, idx: number) {
const t: TerrainTile = new TerrainTile()
const red = this.bitmap.data[idx + 0];
if (red > 100) {