Simple transparency

This commit is contained in:
2026-03-13 13:16:35 -03:00
parent 0310bdaf7a
commit 96a485743f
10 changed files with 163 additions and 99 deletions
+1
View File
@@ -53,6 +53,7 @@ export class EverythingRegistry {
export interface TileRegistry<T = unknown | undefined> {
texture_id: string | ((tile: Block<T>) => string);
has_collision: boolean;
transparent?: boolean;
on_create?(world: ClientWorld, tile: Block<T>): void;
on_click?(world: ClientWorld, tile: Block<T>): void;
+7
View File
@@ -36,3 +36,10 @@ export function distance_point_rectangle(px: number, py: number, sqx: number, sq
return Math.sqrt(dx * dx + dy * dy);
}
export function distance_point_point(ax: number, ay: number, az: number, bx: number, by: number, bz: number) {
const dx = ax - bx;
const dy = ay - by;
const dz = az - bz;
return dx * dx + dy * dy + dz * dz;
}