SWGhost Saga

Building an Interactive Ghost from Core SketchWaveJS Classes

Ghost 1: A Framework

Ghost 1: A Framework

A simple ghost shape built from a few SWDisk instances, with a SWRectangle body. A consistent color scheme is based on the SWColor class. This stage lays the groundwork for the saga by establishing the basic ghost form and color palette, ready to be enhanced with more features in future stages.

Open Ghost 1 →
Ghost 2: Introducing SWGhost

Ghost 2: SWGhost Class

Introduces the SWGhost class. All geometry is encapsulated and derived from a single anchor SWPoint, solving the static-layout problem from Stage 1. The ghost is now fully draggable as a single unit.

Open Ghost 2 →
Ghost 3: The Eyes Have It

Ghost 3: The Eyes Have It

Adds two SWEyeball instances inside the ghost head. Eye size and spacing are randomized from span/gap factors. Pupils are independently draggable; the whole ghost remains draggable as a unit. Also introduces numToes = 0 support for a flat-bottom ghost. Only two color arrays are needed in the sketch.

Open Ghost 3 →
Ghost 4: Haunted Hover

Ghost 4: Haunted Hover

Brings the ghost to life with two SWSinusoid instances — a gentle horizontal drift (period 5 s) and a subtle vertical hover (period 3 s). Drag still works at any time; the base position resyncs on release so animation resumes seamlessly. Press SPACE to toggle.

Open Ghost 4 →
Ghost 5: Living Eyes

Ghost 5: Living Eyes

Merges Stage 4’s sinusoid hover with Perlin-noise eye animation. Pupils wander on their own when idle, track the cursor in Follow mode, or mirror each other in Track mode. A full Control Panel exposes all parameters: Look Strength, Noise Speed, Iris color & width, ghost color, toe count, hover amplitudes/periods, and background opacity for after-image trails.

Open Ghost 5 →
Ghost 6: Stretching

Ghost 6: Stretching

Adds SWGhost.stretching(sinusoid, t) — a third sinusoid that drives body height vertically each frame, analogous to SWRectangle.breathe(). Hover, stretch, and eye wander all run simultaneously via independent sinusoids. The new Stretch Controls card exposes amplitude and period.

Open Ghost 6 →