1 2 3 4 5 6 7 8 9 10 11 12 13 14
var coinImage = new Image(); coinImage.src = "images/coin-sprite-animation.png"; function sprite (options) { var that = {}; that.context = options.context; that.width = options.width; that.height = options.height; that.image = options.image; return that; }