Increasing eyeSize on sprite

I have a student who is working on her interactive card. She has a sprite with eyes. She wants the eyes to increase in size when the user presses the space bar (or some other way). [Originally she wanted the eyes to go blind but couldn’t figure out how to do that either.] Here is the link:

She has tried var eyeSize = 0

Then within function draw she has eyeSize = eyeSize + 1

Can someone help? Thanks.

Hi Karen,

Could you post a link to the code from these students? That would make it easier to help with debugging.

Thank you

Here is the link. I need to figure out how to get back to my post to add it there.

I can’t access the code through this link. In order to create a link to the project, click on “share” in the upper left corner, copy the url and paste into this post.

Have a great Friday

Here is the link:


Thanks for sharing the project - one immediate problem is your student has multiple draw loops, they should only have one, they can create functions that do different things and then call those in the draw loop if they’d like.

The student also needs to create separate sprites for each of the eyes, right now they just have the sprite, but that doesn’t have different components to control - you could have the student create ellipses directly over the existing sprites eyes (figuring out the x, y position) and then you’d be able to modify them. Then, inside of the draw loop they can have an if statement that if the spacebar is pressed, the sprite’s size would increase.

Hope that helps,