I have an object
var nark = add([ sprite("spr_1") ]);
How might I change the sprite to something different programatically? Ive tried both of these, but to no avail:
nark.sprite = sprite("spr_2"); nark.sprite = "spr_2";
Ok, I figured it out by doing some digging. The property that holds the sprite is spriteID, not sprite. So, the following code should work:
spriteID
sprite
nark.spriteID = "spr_2";
Changing the sprite of an object in kaboom.js
I have an object
How might I change the sprite to something different programatically? Ive tried both of these, but to no avail:
Ok, I figured it out by doing some digging. The property that holds the sprite is
spriteID
, notsprite
. So, the following code should work: