Your student is really close. She’s using the if statement correctly for the most part.
The problem is that she’s using two sprites for the background, rather than just changing the animation of one sprite. Right now, she creates both of the sprites, and the one that she creates second shows up, because it’s the one that’s on “top” of the other when all the sprites are drawn.
Then, in her background function, she resets the animations of those two sprites. This isn’t doing anything, though, because those two sprites already have the respective animations that she’s setting them to.
What she should do instead is create only one sprite, and to set it to the image that she initially wants for the background. Then, in the
Background function, use the same if statement, but in both cases set the animation of that original sprite. This way the sprite just changes what it looks like, rather than having two completely separate sprites.