implemented sprite.js, without repeat function