Unit 3 - Game Lab acting strangely


#1

One of my students is working in Unit 3, Lesson 22 on her game. Her code is correct to make the star bounce off edges and the pan, or start over if hit the ground. It works periodically but will stop working in the middle of the game or sometimes at the beginning. This is the link to her game.


We think it’s a bug in game lab as it works sometimes and not at others. We’d appreciate any help you can give on this matter.


#2

What do you mean when you say that it stops working? Can you give specific details about what you expect to happen and what’s happening instead?

Thanks!


#3

For example, her star is supposed to bounce off the pan. Most of the time, it starts bouncing off the pan but if it hits the ground and starts over, it then won’t bounce off the pan. It just goes straight through it. It is also supposed to bounce off the edges but sometimes it does and sometimes it doesn’t.


#4

Hi Jennifer,

For this, I would look for the code that makes the star bounce off the pan, and see under what conditions it is being run. Is it in a conditional?

In this case, it is in a function that’s only being called under certain conditions, which is why the star doesn’t always bounce off the pan. The student code is commented well, but it’s a little disorganized in that it has a lot of things all going on at the same time without using a lot of functions, which might be why it’s hard to see that the code for the star bouncing off the pan is only happening at certain times.

Elizabeth