Extra for Experts: highlight
Extra for Experts: highlight
Image credit: "Waka leaving shore" by Brent Simpson is licensed under CC BY-SA 2.0
Let's highlight the waka piece when someone clicks it, so it clearly shows which part is the hiwi, and adds visual excitement.
We'll do this by briefly changing the brightness of the hiwi.
Highlight
1. Click the Code tab
2. Click the purple Looks drawer
3. Drag the change color effect by 25 block into the coding space, under say hiwi block - do this twice.
4. Click on color and select "brightness" for both blocks
5. Change the number in the 2nd block to -25 (negative)
6. Click the orange Control drawer
7. Drag the wait for 1 seconds block in between the 2 change brightness blocks
8. Test the text by clicking the hiwi on the stage - did it work?
Let's improve this
Did you notice that it didn't highlight until 1 second after it said "hiwi"? That's because the say hiwi block takes 1 second.
Let's fix that:
Drag the top change brightness block down off the say hiwi for 1 seconds block
2. Delete the say hiwi for 1 seconds block by dragging it back into the code blocks area
3. Click the purple Looks drawer
4. Drag the say Hello block under the start sound block and under the 2nd change brightness block. Reconnect blocks.
5. Change the first say block to "hiwi" & the last say block to be empty
6. Test the result - is it better?
7. Finally, find the clear graphic effects block, and put this at the start, before start sound. This prevents the sprite from accidentally getting brighter and brighter when you click it repeatedly.
Woohoo! That's a pretty impressive code stack you've now got! 🎉✨
Ready for the next part of the waka?