# 3.19-Activity 11

**URL:** https://forum.code.org/t/3-19-activity-11/15279
**Category:** Unit and Lesson Discussion
**Tags:** csd-unit-3, csd-unit-3-lesson-19
**Created:** [March 27, 2018, 7:56pm UTC](https://forum.code.org/t/3-19-activity-11/15279 "2018-03-27T19:56:50Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bcunningham](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bcunningham](https://forum.code.org/u/bcunningham)
#### Post date: [March 27, 2018, 7:56pm UTC](https://forum.code.org/t/3-19-activity-11/15279/1 "2018-03-27T19:56:50Z")

</div>

My students and I are having some trouble with Activity 11. When we put the suggested code (If score\<10, simple background, else crazy background) in the draw loop with backgrounds that are sprites, the background covers up the bunny and coin. Some more instructions on how to do this one would be helpful.

---

<div class="post-metadata">

### Author: ![kevinsukhoo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/kevinsukhoo/32/3617_2.png) [@kevinsukhoo](https://forum.code.org/u/kevinsukhoo)
#### Post date: [March 28, 2018, 1:54am UTC](https://forum.code.org/t/3-19-activity-11/15279/2 "2018-03-28T01:54:42Z")

</div>

Yikes!! @bcunningham would you be able to share a link so we can take a look at the code?

thanks!!  
Kevin

---

<div class="post-metadata">

### Author: ![bcunningham](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bcunningham](https://forum.code.org/u/bcunningham)
#### Post date: [March 28, 2018, 11:55am UTC](https://forum.code.org/t/3-19-activity-11/15279/3 "2018-03-28T11:55:43Z")

</div>

Hi, I made it into a project. Here’s the link: [Function Bunny Collector](https://studio.code.org/projects/gamelab/e71CW10sVcWf0XqjOrGVWRg19aE8HiCx2RzDoECI384/edit)

---

<div class="post-metadata">

### Author: ![ksimpson](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@ksimpson](https://forum.code.org/u/ksimpson)
#### Post date: [March 28, 2018, 3:21pm UTC](https://forum.code.org/t/3-19-activity-11/15279/4 "2018-03-28T15:21:14Z")

</div>

I think it is because your backgrounds are pictures/variables. It works if you are using fill colors and shapes and background under the draw tool.

---

<div class="post-metadata">

### Author: ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)
#### Post date: [March 28, 2018, 4:22pm UTC](https://forum.code.org/t/3-19-activity-11/15279/5 "2018-03-28T16:22:37Z")

</div>

@bcunningham

What Kimberley said is right, but you can also do it with sprites. You just have to do it a little differently. Your sprites show up in the order that you create them, with the ones that you create first in the back, and the ones that you create last in the front. When you call your `simpleBackground` and `crazyBackground` functions, you are creating new sprites, so they are going to show up on top of everything else. What you should do instead is create a single background sprite at the top of your code, before you create any other sprites. Then, in your function, only set the background sprite’s animation to the image you want, rather than making an entirely new sprite.

Elizabeth

---

<div class="post-metadata">

### Author: ![sharon.elzey](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sharon.elzey](https://forum.code.org/u/sharon.elzey)
#### Post date: [March 11, 2019, 3:21pm UTC](https://forum.code.org/t/3-19-activity-11/15279/6 "2019-03-11T15:21:09Z")

</div>

Good morning.

My students and I are having the same problem. We have it set up exactly like the recommendation, the new background sprites being drawn in the IF/ELSE statement just before the drawSprites, but it was still drawing the backgrounds on top of the bunny and coin.

I think I understand what you are saying. I will have the student setAnimation to the crazy background image when coins \>10 or the simple background image when coins \<= 10.

---

<div class="post-metadata">

### Author: ![kevinsukhoo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/kevinsukhoo/32/3617_2.png) [@kevinsukhoo](https://forum.code.org/u/kevinsukhoo)
#### Post date: [March 13, 2019, 2:33am UTC](https://forum.code.org/t/3-19-activity-11/15279/7 "2019-03-13T02:33:04Z")

</div>

hi @sharon.elzey!

Let us know what happens!

thanksss!!  
kevin

---

<div class="post-metadata">

### Author: ![edavis](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/edavis/32/4927_2.png) [@edavis](https://forum.code.org/u/edavis)
#### Post date: [March 14, 2019, 1:17am UTC](https://forum.code.org/t/3-19-activity-11/15279/8 "2019-03-14T01:17:34Z")

</div>

Hi @sharon.elzey,  
Just checking in. Did you and your students get everything figured out ok?

---

<div class="post-metadata">

### Author: ![sharon.elzey](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sharon.elzey](https://forum.code.org/u/sharon.elzey)
#### Post date: [March 21, 2019, 12:35pm UTC](https://forum.code.org/t/3-19-activity-11/15279/9 "2019-03-21T12:35:42Z")

</div>

Sorry it took so long to reply. Yes, we tried what was suggested and it worked. The student created a single sprite for the background with two separate images. Then in the IF/ELSE statement in the function he set the animation image for the background he wanted to occur. Thanks!! 🙂
