im not sure what you re doing with your code there but animated sprites can be animated with frame , like my.frame+=10*time;