I am having some difficulty with this activity. I can set the animation to follow the mouse with a World.mouseX and World.mouseY, but the program draws multiple versions of the bee. When I try and copy the example information and use game.mouseX and game.mouseY I am told that the “game” identifier has not been declared.
When it is drawing multiple bees, was your “Background” block inside the draw loop? If it isn’t, it isn’t being redrawn after each bee so each move of the mouse will draw a new bee and not a new background. When you put the draw background inside the draw loop, it should redraw the background before checking for the new Mouse X and Mouse Y values.
So, I’m not a Javascript expert, but it looks like in their programming exemplar, they have used a class called Game rather than world. In our environment (and the students’ environment), they are supposed to use world as the class. Anyone more knowledgable about Javascript care to comment? This may be another “bug” to point out. I hadn’t looked at the exemplar solution before seeing your question and hadn’t noticed that.
This is actually a remnant from an older version of Game Lab, when the global object was Game. We switched the global object to World to encourage students to think more broadly about what they might make. We still support Game for backwards compatibility. I’ll update that exemplar and poke around to see if we have other old ones that need updated.