-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Description
Hello.
I was trying to sequence a series of non-looping sprite animations and ran into this issue where nesting play calls does not work.
sprite.play animation: jump do # block1
sprite.play animation: fall do # block2
sprite:play animation: idle
end
endExpected behaviour
The sprite should jump (6 frame animation), then fall (another 6 frame animation), and then idle (looping animation).
Actual behaviour
The sprite jumps, falls, but never idles, since "block1" gets called, but "block2" never does.
Root cause
The root cause is the order of these lines:
Lines 180 to 181 in dfcec33
| if @done_proc then @done_proc.call end | |
| @done_proc = nil |
Possible fix
Re-ordering them and using a local variable (as follows, for example) should fix the problem:
kept_done_proc = @done_proc
@done_proc = nil
if kept_done_proc then kept_done_proc.call endMetadata
Metadata
Assignees
Labels
No labels