implementing sprite animation update code