Draw Loop, Sprite backgrounds, and Text

Hi All,
I know I have posted about this before, and for some reason, I am still having trouble with text appearing once I add the draw loop- particularly when a sprite is used as a background. The background sprite here has been set outside the draw loop, so I don’t think it’s a case of the background “covering up” the text in the draw loop. I think I figured out that I have to have the text appear after I draw the bird sprite in the loop, but can anyone remind me why this is? Even if the bird sprite is drawn after, it’s in a different location than the text, so why, if I call the text first, will it not appear? I am very curious about the “whys” of coding. Thanks in advance!

@dmurr-pinsker,

Can you check that link and make sure you got it all? It won’t load for me, but if I can see it, I’m happy to try and explain what is happening.

Mike

@mwood Thanks for getting back to me. I updated the links, so hopefully they work now.

When I run your code as is, I can see “flying” appear in the upper left corner of the screen and it isn’t hidden by the background, so if I understand your explanation, I think you are correct.

If you wanted it to appear above the bird, it would have to be after the drawSprites, but in this case, they aren’t overlapping so you can see the text.

Mike