1681-engine / pixel / NightShade
Class: NightShade ​
Defined in: src/pixel/NightShade.ts:26
The outdoor night: a DayClock's grade laid over the world as a dithered Darkness, deepening at dusk and lifting at dawn, with every lamp, window and fire burning a hole in it — the same erase trick an underground is lit by, only with a sheet whose colour and depth follow the clock. A place under no sky (a cave) builds a Darkness of its own instead; at noon the sheet has no alpha and costs nothing.
Constructors ​
Constructor ​
new NightShade(stage, options): NightShade;Defined in: src/pixel/NightShade.ts:32
Parameters ​
| Parameter | Type |
|---|---|
stage | Stage |
options | NightShadeOptions |
Returns ​
NightShade
Methods ​
addLight() ​
addLight(
x,
y,
glowSize,
color?,
flicker?
): void;Defined in: src/pixel/NightShade.ts:44
A light the place glows with, glowSize the diameter of the glow drawn for it: by night it is what is seen by.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
x | number | undefined |
y | number | undefined |
glowSize | number | undefined |
color? | number | undefined |
flicker? | number | 0 |
Returns ​
void
destroy() ​
destroy(): void;Defined in: src/pixel/NightShade.ts:61
Returns ​
void
setLampsDimmed() ​
setLampsDimmed(dim): void;Defined in: src/pixel/NightShade.ts:49
Lamps colour the dark less (a "fewer ambient lights" setting); their holes stay as wide.
Parameters ​
| Parameter | Type |
|---|---|
dim | boolean |
Returns ​
void
update() ​
update(
now,
wallMs,
px,
py
): void;Defined in: src/pixel/NightShade.ts:54
now the frame's ms, wallMs the shared wall time the clock reads (serverNow()), px/py the player.
Parameters ​
| Parameter | Type |
|---|---|
now | number |
wallMs | number |
px | number |
py | number |
Returns ​
void