cadin / panels

Build interactive comics for the Playdate console.
Creative Commons Attribution 4.0 International
163 stars 8 forks source link

Advance sequence to target on timer/delay? #28

Open clarklab opened 2 months ago

clarklab commented 2 months ago

Hey hey! Me again! I've scoured the docs (and tried with Copilot) to find a way to auto-advance a sequence to another target sequence after a certain delay. Is that possible? Pseudo code incoming:

{ 
    -- sequence 1
    title = "Teeth",
    axis = Panels.ScrollAxis.VERTICAL,
    backgroundColor = Panels.Color.BLACK,
    audio = {file = "teeth", loop = false },
    scrollType = Panels.ScrollType.AUTO,
        advanceTimer = {target = 4, delay = 3500 }
...

That advanceTimer is the bit I'm looking to solve for. My guess is the answer is maybe an advanceFunction, but it looks like those only work per panel, and I need the sequence to advance regardless of current panel. Any ideas?

clarklab commented 2 months ago

A little bit of progress (in case anyone else stumbles here in the future), but still looking for the magic bullet. I've been able to use targetSequenceFunction and advanceFunction to dynamically change the target pretty easily, but it still seems to rely on user input to actual advance the sequence and land on the new target.

Still looking for a way to programmatically send player to target sequence, with no additional input, on a timer.