Daily Learning Activity: Subject
Daily Learning Activity: Subject
Activity:
SECRET PLACE
Your jewelry collection was getting big, so you decided to keep some of it in a safe storage in your house. For precautionary
measures, you thought of creating a map that will display where the safe will be placed. You want to put it somewhere that
won’t easily be found; you will only list down the x-y coordinates, and the directions to it. Your task is to create a blueprint of
your room in Scratch. Add a sprite that represents yourself on the Stage, then get the x-y coordinates and directions of the
sprite, which will serve as the secret codes in the blueprint.
1. Open Scratch.
2. Download and extract Secret Place.zip. You should be able to see a folder named Secret Place after extracting the zip file.
3. Add background found inside the Secret Place folder as the backdrop of the Stage.
4. Delete the cat sprite from the Stage since you won’t be using it in this project.
5. Add these objects as sprites in the room: bed, cabinet, carpet, couch, sink, study_table, toilet_seat, tub, and tv. These
can be found inside the Secret Place folder as well. Resize these objects for them to fit perfectly on the Stage.
6. Add scripts to the sprites on the Stage. Start with one sprite (e.g. bed sprite) so that you can just duplicate its scripts later
on. Make the objects in the room say its x position and y position in one say block, and its direction in another say block.
Use the Operators block join () (), the Motion blocks x position, y position, and direction, and the Looks block say () for
() seconds to do this.
7. Add a person sprite, which will represent you on the Stage. Import person_down.png from the Secret Place folder as your
sprite. Rename it to person.
8. Add costumes to the person sprite. Import person_up.png, person_left.png, and person_right.png as costumes. These
can all be found in the same folder.
9. Add scripts to the person sprite. The following are the required functions of this sprite:
When an arrow key is pressed (e.g. up arrow key), the sprite should change its costume (e.g. person_up.png). The
costume of the sprite depends on the arrow key pressed.
After changing its costume, it should go in front of the other objects on the Stage and should change its x or y
position by 10, depending on the arrow key pressed.
An if/then statement should also be used to check if the person sprite is touching an object in the room. If it is,
then it should broadcast a message to all sprites in the project. The broadcast messages that should be used are:
o bed – showbed
o cabinet – showcabinet
o carpet – showcarpet
o couch – showcouch
o sink – showsink
o study_table – showstudy_table
o toilet_seat – showtoilet_seat
o tub – showtub
o tv – showtv
Note: All blocks of the person sprite should be stacked together.
10. Duplicate the scripts of the person sprite three (3) times for the rest of the arrow keys. Change the key pressed of the Hat
blocks, the selected costume in the switch to costume () blocks, and the movement of the sprite (change y by () or change
x by ()).
11. Go to the Code tab of the object that you already added scripts to in step 6 (e.g. bed sprite). Add the Events block when I
receive () before the two say blocks in the Scripts Area, then choose the appropriate broadcast message for the sprite by
clicking the drop-down arrow in the Events block.
12. Duplicate the scripts of the object (e.g. bed sprite) to all sprites in the project except for the person sprite. Make sure to
change the received broadcast message in the Hat block to the message appropriate for the sprite.
13. Save the project and provide a name for it (e.g. Secret Place).
14. Run your project by pressing the arrow keys. When the person sprite touches another object, that object should say its x-y
position and its direction afterwards. The movement and costume of the sprite should depend on the arrow key pressed.