added sprite object creation function