This commit is contained in:
2026-03-07 16:26:12 -03:00
parent 5218fab55a
commit 5ad4188567
12 changed files with 245 additions and 197 deletions
+3
View File
@@ -1,6 +1,9 @@
export const TEXTURE_SIZE = 16;
export const TILE_SIZE = 48;
export const TICKS_PER_SECOND = 20;
export const TICK_DELTA = 1 / TICKS_PER_SECOND;
export const SLOT_SIZE = 18 * 3;
export interface SpriteRegion {
+7 -4
View File
@@ -17,10 +17,13 @@ export class EverythingRegistry {
}
}
export interface TileRegistry {
texture_id: string;
export interface TileRegistry<T = unknown | undefined> {
texture_id: string | ((tile: Tile<T>) => string);
has_collision: boolean;
on_click?(world: ClientWorld, tile: Tile): void;
on_interact?(world: ClientWorld, tile: Tile): void;
on_create?(world: ClientWorld, tile: Tile<T>): void;
on_click?(world: ClientWorld, tile: Tile<T>): void;
on_interact?(world: ClientWorld, tile: Tile<T>): void;
on_tick?(world: ClientWorld, tile: Tile<T>, tick_delta: number): void;
on_second?(world: ClientWorld, tile: Tile<T>, second_delta: number): void;
}