Unit 3-Lesson 17: Score count showing up incorrectly

I have several students creating a score variable in their code.


BEFORE draw loop:
var score = 0

IN draw loop (for example):
text (score, 30, 50)

In Conditional of “ifTouching”
score = score + 1

Several of these students had the starting score show up as 1 instead of 0. I had another student with the score starting at 4 even though they had the above. Several students even looked at the code of their peers and couldn’t figure out the issue. Thoughts?

Generally speaking, this looks like it should work, however, code can run faster than the human eye, so if a collision is taking place early in the loop, the 0 may not be seen before it updates to a higher number. Without seeing a specific example, it’s hard for me to say anything for sure. If you want to post a shared link to one of the projects, I would be happy to look at it.