JS for creating sprites, and sprite related instances