Unit 3 Lesson 22 - We can't figure out why gold won't show up

Can anyone offer help??? My student sent me this email while working on her game project.

“The gold is not showing up, I’ve tried to substitute functions and it still will not work.”

Student’s Game

Thanks so much for any and all help!

Hi @ccrawford,

Can you enable student sharing so we can see the game to see if we can help? Here is an article on how to do that.

Michelle

I enabled student sharing, sorry ,I was unaware it wasn’t enabled.
Thank you for your help!
Cindy

Great! Thanks.
When I first looked at the game and couldn’t see the gold, I used the watch tool to see where the gold actually was (see screenshot). It would not move into a positive x position. That made me think the collision methods were forcing it off the screen since nothing else would have set the x position off the screen.

So, if you go to the animation tab and and crop (see screenshot) all of the obstacles and the start sprite, it allows you to see the gold. I think there is some adjusting with the size of start and some other things but it does allow you to see the gold.
Screen Shot 2019-12-06 at 12.51.03 PM
Screen Shot 2019-12-06 at 12.34.04 PM

Good luck!
Michelle

Solution #4

The gold is colliding with all the other gems, and since they don’t disappear, they will always touch the gold and thus earning points.

Collision is always a rectangle (or a circle or a point), so you will have to create your own colliders (like I did.)

There is a difference between isTouching and collide
One will actually interact with the sprite, and the other just returns a boolean.

Thank you for your reply. Did I understand correctly that she should create colliders??? I’m very new to this. So, I’m feeling very lost myself.
Here is a screen a shot if she changes the “is touching” to collide. I see what you mean about circles / rectangle/ point but not sure how to help her correct it. I’m guessing the circle / point needs to be smaller so the gold isn’t always touching.

Does that make sense??

Thanks again,

@ccrawford, As @melynn suggested, I would suggest starting by editing the gold (and the other jewels) in the animation tab. Right now, they have a lot of blank pixels surrounding them which is making their collision area extend to the blank space surrounding them as you can see in your screenshot.

Then, if she is still not having the desired effect, you can look at the collisions themselves, but I think editing the sprites by clicking on the crop button (see @melynn’s post above) will solve a lot of the issues going on.

If not, we are happy to keep working with you on it!

Mike