allow sprite loop setting. refactored setspriteframes()