Skip to content
Changing the sprite of an object in kaboom.js
Profile icon

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";
You are viewing a single comment. View All
Profile icon

Kaboom auto-loads sprites, so the above methods still don't work. Documentation doesn't say anything, that's why I'm here :)

Thanks though.