rewrite sprite sequence logic