Increasing eyeSize on sprite

#1

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: https://studio.code.org/s/csd3-2018/stage/14/puzzle/8

She has tried var eyeSize = 0

Then within function draw she has eyeSize = eyeSize + 1

Can someone help? Thanks.

#2

Hi Karen,

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

Thank you

#3

Here is the link. I need to figure out how to get back to my post to add it there.
https://studio.code.org/s/csd3-2018/stage/14/puzzle/8

#4

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

#5

Here is the link: https://studio.code.org/projects/gamelab/X9PG-j3cwnFjlNnxgUF3Ty3juPy-8IyvaKRAcJGsj8o

#6

Karen,

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,
Brad