Varied Secquencedata Timing For A Blinking Eye?

When creating a newSprite with an imageSheet and animated sequence, I can define timing like this

local sequenceData = {     name = 'default',     frames = {1, 2},     time = 100 }

Presuming that frame 2 is a blinking eye, how would I time it so that it plays 1 for say 2000ms but blinking 2 for just 100ms?

thanks!

How about

... frames = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 }, ...

It will simply repeat frame #1 for 2 seconds, then throw frame #2 for that split-second.

Can’t you make a function that changes the image to blinking image and changes it back after a short time. And than you can call that with random intervals.

@BeyondtheTech’s suggestion is a good one, in my opinion. This is very useful method in animation to provide “spacing” of a longer interval on one frame without repeating the same frame in the image sheet. You could accomplish the same basic thing with a repeating timer function, but I think the spacing method is easier.

Brent

Thanks guys! I guess I’ll go back to how I usually did it before, using a little semi randomized phase counter…

How about

... frames = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 }, ...

It will simply repeat frame #1 for 2 seconds, then throw frame #2 for that split-second.

Can’t you make a function that changes the image to blinking image and changes it back after a short time. And than you can call that with random intervals.

@BeyondtheTech’s suggestion is a good one, in my opinion. This is very useful method in animation to provide “spacing” of a longer interval on one frame without repeating the same frame in the image sheet. You could accomplish the same basic thing with a repeating timer function, but I think the spacing method is easier.

Brent

Thanks guys! I guess I’ll go back to how I usually did it before, using a little semi randomized phase counter…