CS Discoveries, Unit 3 Lesson 26 Bubble 13

My student’s game should have the stars descending, and when they hit the bottom, the stars get sent back to the top (y = -10). At that point they should start descending again, but they stay at the top and never descend. What is the student doing wrong?

Thank you very much.

Gary Ellis

Can you share the “share” link with us so we can look at it? Without that, it’s a little hard to tell…

A few things in the absence of that link…

  • do you have a block using the counter pattern (stars.y = stars.y +1;) inside the draw loop?
  • Do you have a background block inside the draw loop?

We are happy to take a look if you can send the link!

Good luck!

Mike

Hi:

I’m not sure why it didn’t send yesterday - here it is. Thanks very much.

I added some watchers to watch the following values …

Here’s what I observed.

Screen Shot 2021-11-30 at 2.20.30 PM

So, you can see that after falling the first time, the first star (s) jumps back as intended, but always stays at -10. The 2nd star (and 3rd and 4th) continue to fall down the screen. If you look at these lines, I’m guessing you’ll see why…

99, 100, 103, 104, 107, 108, 111, 112

Let us know if that helps solve the problem!

Good luck!

Mike

1 Like

Hi - thanks very much for the reply. I didn’t quite get how to change the code…BUT…I noticed that in a couple of cases, the student had mislabeled a command for a. particular sprite. There were three lines of code which should have had the same name for each (e.g. S1). Instead, the first line showed “S1” but the second and third lines showed just “S.” When she made the changes, everything seemed to work fine.
Thank you again!

Gary Ellis

1 Like