Unit 3 Flyer Game Debugging Help

Hi,

The code seems right but scoring is inconsistent. It should award points when the baby touches the diapers, which it does sometimes, but it is inconsistent.

Here’s the game—can you help?

Game Link

Thanks,

1 Like

@michael_glennon ,

Good morning! Looks like a fun take on the flyer game. I like it.

I just looked at the code and lines 81 & line 86 are both checking for the same collision between the baby and the diaper. In one of them, it moves the diaper to a new location. In the other, it adds to the score. Sometimes, it is moving the diaper before the other condition runs, so the diaper is no longer touching and the score doesn’t change.

What about combining those two statements, so if the collision occurs, the diaper moves and the score is changed (without having to check for the collision again).

Good luck!

Mike

It worked! Thank you! :grinning: