Student game needs help! Meteors aren't resetting

My student is working on a game in which the meteors reset after they’ve been eliminated by the laser. Her functions show code for each meteor resetting to a certain position and they’re supposed to reappear on the screen with a velocity of 4 and rotation speed of 2, but it isn’t happening. We tried adding a visibility command but that didn’t work. Any ideas?

Miss Clarke,

After some testing - I believe the issue is with the randomNumber scale… In my troubleshooting/debugging process I broke down each line to see where the issue was and then created some “watchers” in the bottom right corner to check values. The randomNumber block is sometimes returning a 0 value and sometimes returning a 1 in my code because I have the range as 0.5 -> 1.2. In your students code it’s 0.2 -> 0.5 which is always going to result in a 0.

If the student sets the scale to a static number, it will work and then we need to look into why randomNumber is only allowing int’s and not doubles/floats.

Sorry that did solve the ultimate problem, but it’s enough to get a working game and know where to look into.


Hi @clarkea,
I just wanted to check in to see if Brad’s answer helped you or if you still need help with the project. Just let us know. Thanks!