Page 132 - ScienceStd4
P. 132
the Sprite will ‘go to a random position’. Second, the Sprite
will ‘rotate 30 degrees(anticlockwise)’. Third, if the Sprite is at
‘the edge’, it will be ‘returned’. The following steps will guide
you in creating this game. Refer to Figure 28.
FOR ONLINE READING ONLY
Steps
1. Click on the ‘Events’ block menu, drag and drop the ‘when
clicked’ block on the script area.
2. Click on the ‘Motion’ block menu, drag and drop the ‘go to
(random position)’ block on the script area.
3. Attach the ‘go to (random position)’ block to the ‘when
clicked’ block.
4. Drag and drop the ‘turn (Q) 15 degrees’ block on the
script area.
5. Attach the ‘turn (Q) 15 degrees’ block to the ‘go to (random
position)’ block.
6. Change the degrees from 15 to 30 degrees.
7. Drag and drop the ‘if on edge, bounce’ block on the script
area.
8. Attach the ‘if on edge, bounce’ block to the “turn () degrees’
block.”
125
14/01/2025 18:38
SCIENCE AND TECHNOLOGY STD 4.indd 125 14/01/2025 18:38
SCIENCE AND TECHNOLOGY STD 4.indd 125