Animation not working

One of my students in CD is creating his game in Unit 3, lesson 22. He has created 3 sprites with animations. In the animation tab, the sprites work correctly. When he creates the sprites on the code side and adds the animations, only 1 of the sprites works correctly. The other 2 do not animate. We have tried deleting the animations, deleting the sprites in the code and nothing helps. Here is a link to the student’s code:


Thanks for your question! Had me stumped for a minute before I discovered the issue.

Short answer: He needs to add a background sprite inside the draw loop.

Long answer: What is happening is that the two that “aren’t” animating, actually are animating, but the changes happen once and are never “cleared” because a new background isn’t drawn. The one that is appearing to animate is only doing so because it’s in the face and each time the sprite is redrawn, the flesh is redrawn which covers the red spot coming from his eye. On the other two, a background is needed so when the background is drawn, it will clear the sprite completely before drawing the 2nd frame.

That may not appear to make sense. Not quite sure how to put it in words, but if he adds a background block (even if it’s only white), the animations will show up.

Hope this helps!


1 Like

Thank you sooo much for your quick response! I can’t believe I didn’t catch that - but I am certainly thankful you did :slight_smile:

1 Like