Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this video, you will change the size
of your sprite using keypress commands.
To change the sprite's size,
go to the looks menu and pull out a change size by block
into the scripts area.
Use a when key pressed block to tell the program
when to change the sprite's size.
In this project, the right arrow makes the sprite bigger.
To make the sprite smaller,
duplicate the stack and change the value to be negative.
For example, in this project,
the value in the when key pressed block changes
from right arrow to left arrow.
And the change size by block's value becomes -10.
Test it using the left and right arrow keys.
Feel free to tinker with the values of the blocks
to change the look of your sprite.
When you're finished add the new instructions
to the project page.
Under instructions, let the user know
that the left arrow makes the sprite smaller
and the right arrow makes the sprite bigger.
Now it's your turn.
Change the size of your sprite using a change size by block.
Use keypress events to determine
when the sprite changes size.
Add another block stack, and change the values
to make the sprite grown and shrink.
And finally, add instructions to the project page.