implementing the whole class based on the Sprite class