Simple transparency
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user