FlyingToastersEffect
Source:
FlyingToastersEffect.h
FlyingToastersEffect¶
src/light/effects/FlyingToastersEffect.h:101Inherits:
EffectBase
Effect: chrome toasters with flapping wings and toast drift diagonally across the dark.

Inspired by After Dark's Flying Toasters, at Frank's suggestion of sprite support. The art is drawn fresh here, since the original is Berkeley Systems' and was famously litigated.
Public Attributes¶
uint8_t toasters = 5
: How many toasters fly.
uint8_t toast = 3
: How many slices of toast fly with them.
uint8_t speed = 96
: How fast the flock drifts.
uint8_t spriteSize = 0
: Pixels per art pixel, where 0 scales with the grid.
bool audioReactive = false
: Move to the music, each sprite on its own band, holding still in silence.
Public Methods¶
virtual inline const char * tags() const override
: Catalog tags: the audio glyph applies when audioReactive is set.
virtual inline Dim dimensions() const override
: A flock needs a width and a height, so it is a 2D effect.
virtual inline void defineControls() override
: Publish both counts, the drift, the sprite scale and the audio switch.
virtual inline void prepare() override
: Size the pool's storage, wire the view over it, and fill the sky.
inline uint8_t spriteScale() const
: The sprite magnification, grid-proportional when spriteSize is 0.
virtual inline void tick() override
: Drift the flock, respawn whatever left the frame, and draw each sprite.
Public Static Attributes¶
constexpr uint8_t kPool = 20
: The pool size: both count controls at their maxima.
More info¶
The construction¶
Movement is particles::Pool at a constant diagonal velocity, respawning as it wraps. Appearance is the stateless [draw::sprite]. The wing flap is one BeatPhase, offset per toaster so the flock never syncs.