Skip to content

1681-engine / pixel / pixelPaint / tail

Function: tail() ​

ts
function tail(
   g, 
   x, 
   y, 
   vx, 
   vy, 
   len, 
   color, 
   thick?
): void;

Defined in: src/pixel/pixelParticles.ts:35

A particle's trail: len px back from its head (x, y) against its velocity (vx, vy), glint to shade, its far half broken into every other pixel. thick 2 lays a second row under it on the shaded side (down, or right for a trail running straight up or down) a tone deeper, so the trail has a body; 3 adds a lit row on the up-left side over its near half. Light comes from the up-left, as on the rest of the art.

Parameters ​

ParameterTypeDefault value
gGraphicsundefined
xnumberundefined
ynumberundefined
vxnumberundefined
vynumberundefined
lennumberundefined
colornumberundefined
thicknumber1

Returns ​

void

Released under the MIT License.