Code help for Lesson 20

My student created this game: https://studio.code.org/projects/gamelab/ZiihJxNoCeb7DMCXMZM0pn-5KeVASdxdnC1KNbHgd38

When it is run, we get this error message: ERROR: Line: 32: Error: Error: overlap can only be checked between sprites or groups

When I looked up this error message I got this: The message “ overlap only works with sprites ” most likely means that the program was expecting a sprite , but got something else. So, something that the programmer intended to be a sprite was, in fact, not a sprite .Mar 5, 2019

To me, his code looks good. Any help/suggestions? Thank you!

Hi @jennifer.hemry,

I saw a few things that appear to have fixed it for me:

  • In line 13, coin scale is set to .5 and it gives an error. Changing it to 0.5 eliminated the error for me.
  • I tried to figure out why there was an overlap error in line 32 and it looked good to me. I read below to see if anything else was odd, and noticed they were incrementing “coin” in line 33. Coin is a sprite, not a regular variable, so that was a little odd. I thought maybe they meant to increment score & changed it. That seems to make it work for me.

Does that help? Does it work on your end if you make those changes?

–Michael K.

YEAH! That worked! :slight_smile: LOL! Can’t believe I missed that. Looking at too much coin today.

1 Like

OOPS! Too much code not too much coin. I’m losing it.

1 Like

No worries – more often than not, it’s silly little things that make the biggest problems. Glad to help :slight_smile:

1 Like