Closed l8doku closed 1 year ago
Version: 3000.0.0-beta.0 (applies to master, too)
I load a sprite like this:
loadSprite("marksteroid", "/sprites/marksteroid_sheet.png", { sliceX: 2, sliceY: 1, anims: { normal: 0, boost: 1, } })
Where the first frame (0) is considered an anim by itself.
The code below has a check if(!anim) which works both for when anim isn't found and when anim is a literal number 0.
if(!anim)
https://github.com/replit/kaboom/blob/master/src/kaboom.ts#L4342
So when an anim exists, the error is still thrown.
It can be reproduced here https://3000.kaboomjs.com/play?example=sprite if you replace the "idle" anim's dictionary with "idle": 0 .
"idle": 0
Thanks for reporting, fixed in https://github.com/replit/kaboom/commit/47347144ec9ca1078aab046cf9f8ec75dc9516a2!
Version: 3000.0.0-beta.0 (applies to master, too)
I load a sprite like this:
Where the first frame (0) is considered an anim by itself.
The code below has a check
if(!anim)
which works both for when anim isn't found and when anim is a literal number 0.https://github.com/replit/kaboom/blob/master/src/kaboom.ts#L4342
So when an anim exists, the error is still thrown.
It can be reproduced here https://3000.kaboomjs.com/play?example=sprite if you replace the "idle" anim's dictionary with
"idle": 0
.