# Lesson 13 Activity 7

**URL:** <https://forum.code.org/t/lesson-13-activity-7/22186>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-13\
**Created:** [November 15, 2018, 4:30am UTC](https://forum.code.org/t/lesson-13-activity-7/22186 "2018-11-15T04:30:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdavis](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tdavis](https://forum.code.org/u/tdavis)\
**Post date:** [November 15, 2018, 4:30am UTC](https://forum.code.org/t/lesson-13-activity-7/22186/1 "2018-11-15T04:30:31Z")

</div>

I have tried all the if/else combinations I can think of to get the bees to appear over the flower and disappear when not over the flower and I just can’t get it. Someone please help! I’ve been on this same activity for 4 hours. I need to be lead learner on this activity soon!

---

<div class="post-metadata">

**Author:** ![tdavis](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tdavis](https://forum.code.org/u/tdavis)\
**Post date:** [November 15, 2018, 5:02am UTC](https://forum.code.org/t/lesson-13-activity-7/22186/2 "2018-11-15T05:02:04Z")

</div>

Never mind. I finally got it.

---

<div class="post-metadata">

**Author:** ![robinsont](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@robinsont](https://forum.code.org/u/robinsont)\
**Post date:** [November 27, 2018, 9:53pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/3 "2018-11-27T21:53:54Z")

</div>

Hi tdavis. I’m struggling with this one too. Can you please share your solution?

---

<div class="post-metadata">

**Author:** ![robinsont](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@robinsont](https://forum.code.org/u/robinsont)\
**Post date:** [November 28, 2018, 1:22pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/5 "2018-11-28T13:22:48Z")

</div>

It makes sense with the visible commands! I always remind my students that there’s more than one way to solve a problem. Thank you so much! 🙂

---

<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:** [November 29, 2018, 12:26am UTC](https://forum.code.org/t/lesson-13-activity-7/22186/6 "2018-11-29T00:26:53Z")

</div>

It’s absolutely awesome to see people supporting one another on here, however, the forum is not locked down from students. Could you remove your solution so we can continue to encourage students to problem solve their solutions? Please feel free to share solutions such as this via direct message to other users. Goodness knows we need help sometimes too! 🙂 Thanks!

---

<div class="post-metadata">

**Author:** ![tdavis](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tdavis](https://forum.code.org/u/tdavis)\
**Post date:** [November 30, 2018, 2:29pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/7 "2018-11-30T14:29:53Z")

</div>

Done. Thank you for letting me know! I thought it was a teacher only place.

---

<div class="post-metadata">

**Author:** ![sstumpenhaus](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@sstumpenhaus](https://forum.code.org/u/sstumpenhaus)\
**Post date:** [December 10, 2018, 7:00pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/8 "2018-12-10T19:00:32Z")

</div>

Were you able to get the solution for this? I’m STUCK!

---

<div class="post-metadata">

**Author:** ![tdavis](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tdavis](https://forum.code.org/u/tdavis)\
**Post date:** [December 11, 2018, 3:40pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/9 "2018-12-11T15:40:35Z")

</div>

Here is what I did:

var flower = createSprite(100, 200);

flower.setAnimation(“flower”);

var bee1 = createSprite(randomNumber(0, 400), randomNumber(0, 400));

bee1.setAnimation(“bee”);

var bee2 = createSprite(randomNumber(0, 400), randomNumber(0, 400));

bee2.setAnimation(“bee”);

var bee3 = createSprite(randomNumber(0, 400), randomNumber(0, 400));

bee3.setAnimation(“bee”);

World.frameRate = 20;

function draw() {

background(‘lightgreen’);

bee1.x = World.mouseX + randomNumber(-50, 50);

bee1.y = World.mouseY + randomNumber(-50, 50);

if (bee1.x \< 200) {

```
bee1.visible = true;

```

} else {

```
bee1.visible = false;

```

}

bee2.x = World.mouseX + randomNumber(-50, 50);

bee2.y = World.mouseY + randomNumber(-50, 50);

if (bee2.x \< 200) {

```
bee2.visible = true;

```

} else {

```
bee2.visible = false;

```

}

bee3.x = World.mouseX + randomNumber(-50, 50);

bee3.y = World.mouseY + randomNumber(-50, 50);

if (bee3.x \< 200) {

```
bee3.visible = true;

```

} else {

```
bee3.visible = false;

```

}

drawSprites();

}

---

<div class="post-metadata">

**Author:** ![andrea.burgess](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@andrea.burgess](https://forum.code.org/u/andrea.burgess)\
**Post date:** [February 28, 2020, 5:43pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/10 "2020-02-28T17:43:02Z")

</div>

My students are working on the challenge to make the bees appear only over the actual flower (not the stem).  
While I know this is definitely not the most ‘efficient’ way to code this - I’m struggling to find why this code doesn’t work for this:

> **[Check out what I made](https://studio.code.org/projects/gamelab/0uECYvnXeqRXvXnDmvp0vnkEtQTs-jBVnwQJ0KJfCsI)**
>
> I wrote the code myself with Code.org

  
Thanks!!!

---

<div class="post-metadata">

**Author:** ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)\
**Post date:** [February 28, 2020, 6:13pm UTC](https://forum.code.org/t/lesson-13-activity-7/22186/11 "2020-02-28T18:13:03Z")

</div>

@andrea.burgess,

If I go line by line from top to bottom, here is what I see:  
If the mouse.x is less than 200, then check the mouse.y and if that is less than 200, then show and wiggle the bee.

BUT if mouse.x is more than 200, don’t check the mouse.y and **hide the bee**. Once that happens, **there are no instructions to make the bee visible again once it has been hidden** even if the first if statement is true 🙂.

Hope that helps,  
Michelle
