Hi,
I’ve completed the assessment and it basically works. However, there seem to be two small differences between the function of my game and the reference game.
The evilCircle picks up the balls and they disappear. But they actually seem like they are still moving about the Canvas, just hidden. I can tell this by the fact that when I get down to about 5 balls, I can watch one of the remaining balls randomly change color! Which must be from a collision with another hidden ball? Also, my balls seem to flicker more color wise upon collision than in the reference game.
I’ve compared my source code to the reference source code. While I choose to implement the objects using Class definitions with inheritance, the methods seems to be performing the same functions. So, I’m at a loss as to explain the behavior differences. Any help would be greatly appreciated.
I’m also curious as to why the setControls method for the EvilCircle class had to assign its “this” to a local let “_this”. Is this because it’s basically an event handler and method’s normal “this” could change from its load time closure?
My source code is located in CodePen here
Thanks!
Roy