Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I have a zazz question. (I couldn't find a separate forum post dedicated to this module). I'm using `zazz.march` to move a canvas through several points. How do I programmatically "stop" the marching animation? Or put in on hold and resume later?

The zazz.march[] function is designed for very simple looping animations. It is tied to Decker's global frame counter, which makes it easy to use, but limits its flexibility.

If you have an animation that involves starting and stopping- or even starting and finishing- on a more detailed schedule, like a "cutscene", I'd recommend taking a look at Puppeteer. It defines a language for moving "puppets" around on the screen in various ways, playing sounds on cue, and quite a bit more.

The "ease" module offers another lower-level alternative, with functions for tweening a position along a spline defined by a series of control points.

Does any of that help?

Got it. I liked `zazz.march` exactly because of its simplicity :) The only thing lacking for my use case is "halting" the animation (or all animations currently managed by zazz) . I don't know how it fits with your architectural vision for the zazz module, but it would be nice if it exposed some kind of a `purge` method that just stops any active animations managed by zazz (by purging its internal state). Or, better off, a method for "unregistering" individual targets that are currently being animated. 

Anyway, I'll be looking for workarounds. Thanks!