Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
57 views
27 pages
Scratch5 - Paintbox
Uploaded by
Andro
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save scratch5- paintbox For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
57 views
27 pages
Scratch5 - Paintbox
Uploaded by
Andro
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save scratch5- paintbox For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save scratch5- paintbox For Later
You are on page 1
/ 27
Search
Fullscreen
4117126, 11.08 aM Paint box 8 Projects Paint box Make your own paint program Step1 Introduction Make your own paint program! What you will make Youwill click on the green flag to start, and you'll use the mouse to move the pencil and hold down the left mouse button to draw. Clicking on a colour will change pencil colours, and clicking on the eraser will change to the eraser! aan 0n 4X jn Gee + Add the pen extension in Scratch + Use broadcasts to control a sprite in Scratch + Recall how to respond to mouse events in Seratch nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint ser4117126, 11.08 aM Paint box + Acomputer capable of running Scratch 3 Software + Scratch 3 {either online (https: /rpf.io/scratchon) or offline (https://rpfio/scratchoff)) Downloads + Offline starter project (hitis://rntio/p/en/paint-ox-go) © sesttonatintrmaton for eds If you need to print this project, please use the printer-friendly version (https://projects.raspberrypi.org/en/p rojects/paint-box/print) You can find the completed project here (nttps://rpf.io/p/en/paint-box-get) nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 274117126, 11.08 aM Paint box Step2 Makea pencil Start by making a pencil that you can use to draw on the Stage. Open the ‘Paint box’ Seratch starter project. Online: open the starter project at rpfio/paint-box-on (http: /rpf.io/paint-box-on) Ifyou have a Seratch account you can make a copy by clicking Remix. Offline: open the starter project (https://rpf.io/p/en/paint-box-go) in the offiine editor. If youneed to download and install the Scratch offline editor, you can findit at rpfio/seratchoff (http s:l/mpfio/scratchoff) In the starter project, you should see pencil and eraser sprites: pearl eraser nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 327sas 050 Parton Atha Pe eransin ta your poet © tow 24a ha Pon extension ‘To.use the Pen blocks in Scratch, you need add the Pen extension, + Click on the Add extension button in the bottom left-hand corner. ‘+ Click on the Pen extension to acd it ‘+ The Pen section then appears at the bottom of the blocks menu, nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 4274117126, 11.08 aM Paint box @ 1@ fe iele 8 ? i pear.) jj so that you can ‘Add some cade to the pencil sprite to make the sprite follow the mouse pointer {i craw: 4 rc Gey coca Pad Glick the flag and then move the mouse pointer around the Stage to test whether your code works. Next, make your pencil only draw ff the mouse button is being clicked, npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint 5274117126, 11.08 aM Paint box ‘Add this code to your pencil sprite: OTe oc) tg Ce can te aa Z pendown Oc 7 nn ‘Test your code again. This time, move the pencil around the Stage and hold down the mouse button. Can you draw with your pencil? © rves yourpenainet draw om tsi Ifthe line your pencil draw looks ike itis coming trom the pencil's middle, you need to change your pencil sprites so the tip is the sprite’s centre, npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint4117126, 11.08 aM Paint box Glick on the pencil sprite, and then click on the Costumes tab. Move the costurne's so the tip of the pencil is just above the centre. Now move the pencil around on the Stage and draw. The pencil should now draw a line fromitstip. nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 774117126, 11.08 aM Paint box Step3 Coloured pencils Now you're going te acd different coloured pencils to your project and allow the userto choose between them, Click on the Costumes tab of the ‘genci sprite. Rename the penci1=a costume to penciT=blue Soom | f comms | ae Sonts ~——o og. Right click on the pencil-blue costume and select duplicate. Som Somme | qsnnie Name the new costume ‘pencil-green, and colaurthe pencil green. 1 7 penci-blue 102121 nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 8274117126, 11.08 aM Paint box Draw two new sprites: one blue squate and one green square. These are for choosing between the blue and green pencil Sprite Pencil ox show OB Sue | 70 Rename the new sprites so that they are called ‘blue’ and ‘green’ © renames sprtinserton To rename a sprite in Scratch, click on the sprite: Edit the name of the sprite. nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 9274117126, 11.08 aM Paint box ‘Add some code to the ‘green’ sprite so that when this spite is clicked, it THEERISESES the message “green” RMS Ce cc) Dre aa e Broadcast a message in Scratch AGIIDEEIESD is @ way of sending a message which can be heard by all sprites. Think of it lke an announcement made over a loudspeaker. Broadcasting spells: Use the magic wand to click on the buttons and cast spells, what does each spell do to the characters? See inside (httns://scratch.mitedu/projects/518413238/editor) Youcan create a message to be The message text can be anything you like, but its Useful to give it a sensible description. + Find the [SERIES block under SES + Select New Message in the drop-down menu. New message ern] + Then type your message Now Mossago New message name npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint 10274117126, 11.08 aM Paint box Send a broadcast You can decide when to SiSERIEES your message. For example: PM ceo Dee aU ad Ra en eo Om aCe Receive a broadcast block. Multiple sprites can respond Sprite can react toa byusinga when they receive the same message. You can add blocks below a biock te tell the sprite(s) what to do when they receives. ‘the message. Pe ad Centers? “negative numbers decrease the size Pn eC Boe oR) ‘The pencil sprite should listen forthe “green” message and change its costume and pencil colourin response. npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint wer4117126, 11.08 aM Paint box ‘Switch to your pencil sprite. Add some code so that when this sprite receives the broadeast. it switchs to the green pencil costume and changes the pen colourto green. Rao Ciccuad Ennead Peed Ped ane 4 ‘To set the pencil to colourto green, click the coloured square in the Sm Gj block, and then click on the green square sprite. Then toa similar thing so that you can switch the pencil colourto bive. nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint sar4117126, 11.08 aM Glick on the blue square sprite and add this code: Ra Ae Raa eC aod Then click on the pencil sprite and ad¢ this code: PT Po e Sees USTe nd 7 setpen color to ( nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 13274117126, 11.08 aM Paint box Finally, add this code to tell the pencil snrite which colour to start with, and to make sure that the screen is clearwhen your program starts. Oa oc) Ce sstume to penci ot umn cog PNM CE Cand Geto aaa eo Oe 7 nn If you prefer, you can start with a different colour pencil npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint saer4117126, 11.08 aM Paint box ‘Test your code. Can you switch between the blue and green pencil colours by clicking on the blue or green square sprites? nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 18274117126, 11.08 aM Paint box & chationget Challenge: more pencils Can you add red, yellow, and black pencils to your paint prograrn? Take a lock at the earlier steps if you want a reminder of how to do this. Can you use your pencils to draw a picture? nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 16274117126, 11.08 aM Paint box Step 4 Undo mistakes Sometimes mistakes happen. so add a ‘clear’ button and an eraser button. ‘Add the ‘X-block sprite from the library's letters section. Colour the sprite's costume in red and make it a little smaller. This sprite is the ‘clear button. © ses srte rr these rary Click on Choose a Sprite to open the Sprite Library: You can search fora sprite, or browse for one by category. Click on a sprite to add it to your project ter °° ox4"r oma }* €& kee nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint ser4117126, 11.08 aM Paint box block sprite to clear the Stage when the sprite clicked. ‘Add code to the » PCRS eRe) erase all A You don't needto use a to clearthe Stage, because the | block does that job. Do yousee that the pencil sprite includes an eraser costume? 4 7 pencite 102% 121 Your project also includes a separate eraser sprite. npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint 18274117126, 11.08 aM Paint box Click on this eraser sprite and then select show. Show O | @ Here is how your Stage should look now: : 4% ‘Add code to the eraser sprite to send an ({SIEETTMELTRECIEN? when the eraser sprite is clicked. PS Cec) Pile Ca ad ‘when the pencil sprite receives the ‘eraser’ message, it should switch its costume to the eraser and switch the pen colour to white, which is the same colour as the Stage! npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint 19274117126, 11.08 aM Paint box ‘Add some code to create the eraser. Ineed a hint Here is what the code should look like: PCR Seana uaa WP |ccrecncazto( > Test your project to see if you can clear the Stage and erase pencil lines. ‘There's one more problem with the pencil: you can draw anywhere on the Stage, including nearthe ‘clear’ and eraser buttons! nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 20274117126, 11.08 aM Paint box ‘To fix this, change the code so that the pen is only down if the mouse is clicked and the y position of the mouse pointers greaterthan 120: er] i El Meike Maun Tn rs PNM CE Cand mouse down? and areca (-120) 7 Pen-down else 7 nn npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint aint4117126, 11.08 aM Paint box Test your project. You now should not be able to draw nearthe buttons, if VUES if nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint zaer4117126, 11.08 aM Paint box Step5 Change the pen width Next youwill add code to allow the person using your program to draw things with different pen widths. First, add a new variable called (E09. ©} A114 variable in seraten “+ Click on Variables in the Code tab, then click on Make a Variable. er, Variables ake 2 Vane lake Lat ‘+ Type in the name of yourvariable. You can choose whether you would like your variable to be available to all sprites, or to only this sprite, Press OK. "Now variable name: @For all spites OFor this sprite only + Once you have created the variable, it will be displayed on the Stage, or you can untick the variable in the Scripts tab to hide it nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 2374117126, 11.08 aM Paint box Add this line inside the loop of the pencil sprite's code: Oa 7 setpen mon fore COONS coca Ree ema mouse down?» and | mousey > QED Peay pen up ‘The pen width now repeatedly gets set to the value of the variable. npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint i 2ae7‘11724, 14.08 aN Paint box Right-click on the variable displayed on the Stage, and then click on slider. width GD normal readout large readout You can now drag the slider that is visible below the variable to change the variable's value, width GE E ‘Test your project and see if you can change the pen width. nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 251074117126, 11.08 aM Paint box & chattenget Challenge: keyboard commands Can you add code so that, instead of clicking on the coloured squares or buttons on the Stage, you can make things happen by pressing keyboard keys? For example: + b= Switch to blue pencil + g=switch to green pencil +e = switch to eraser + c=clearscreen IF you want te, you can also add code so that pressing the arrow keys changes the pen width. nipsifprject.raspberrypiorgleniprojectsipaint-boxiprint 28074117126, 11.08 aM Paint box Step6 What next? Now that you have completed the ‘Paint box’ project, try the ‘Boat race’ project (hitps://projects.raspberrypior /en/projects/boat-race?utm_source:pathway&utm_medium=whatnext&utm_campaign=projects). which helps you make a game where you have to stira boat around obstacles. Published by Raspberry Pi Foundation (https://www.raspberrypi.org) under a Creative Commons license (https://creativecommons.org/licenses/by-sa/4.0/). View project & license on GitHub (https://github.com/RaspberryPiLearning/paint-box) npsuifprojects.raspherrypiorg/eniprojectsipaint-boxiprint amet
You might also like
Anskey Scratch Worksheet 2
PDF
No ratings yet
Anskey Scratch Worksheet 2
3 pages
Microbit Workshop
PDF
No ratings yet
Microbit Workshop
41 pages
Getting Started With Scratch 3.0
PDF
100% (2)
Getting Started With Scratch 3.0
14 pages
Getting Started With: Create Your Own Games, Animations, Interactive Stories, and More
PDF
No ratings yet
Getting Started With: Create Your Own Games, Animations, Interactive Stories, and More
15 pages
The MagPi Essentials - Learn To Code With Scratch - Make Simple Games and Applications On Your Raspberry Pi PDF
PDF
No ratings yet
The MagPi Essentials - Learn To Code With Scratch - Make Simple Games and Applications On Your Raspberry Pi PDF
92 pages
UWB Tracking System For Patient
PDF
No ratings yet
UWB Tracking System For Patient
107 pages
Project 5-Paint - Box
PDF
No ratings yet
Project 5-Paint - Box
21 pages
Cool Scratch Projects TOCCh1 1
PDF
100% (5)
Cool Scratch Projects TOCCh1 1
22 pages
Computer Programming and Game Design With: Scratch
PDF
100% (3)
Computer Programming and Game Design With: Scratch
48 pages
Essentials Scratch v1
PDF
No ratings yet
Essentials Scratch v1
12 pages
Lesson 5 V3
PDF
No ratings yet
Lesson 5 V3
7 pages
Chapter 10: Scratch Assignment Solutions
PDF
100% (4)
Chapter 10: Scratch Assignment Solutions
3 pages
Grade 6 Computer Science
PDF
No ratings yet
Grade 6 Computer Science
4 pages
Space Talk Introduction of Scratch
PDF
No ratings yet
Space Talk Introduction of Scratch
23 pages
Scratch Programming in Easy Steps PDF Sampler
PDF
81% (27)
Scratch Programming in Easy Steps PDF Sampler
35 pages
Scratch Getting Started Guide
PDF
No ratings yet
Scratch Getting Started Guide
14 pages
Reference Guide: 3. Scratch Blocks
PDF
No ratings yet
Reference Guide: 3. Scratch Blocks
8 pages
Module 4
PDF
No ratings yet
Module 4
20 pages
Drawing With The Pen Block in Scratch
PDF
No ratings yet
Drawing With The Pen Block in Scratch
2 pages
Getting Started With Scratch
PDF
No ratings yet
Getting Started With Scratch
130 pages
Ch-5 Solutions
PDF
No ratings yet
Ch-5 Solutions
2 pages
CL4 - CH2 - Drawing A Square 2
PDF
No ratings yet
CL4 - CH2 - Drawing A Square 2
25 pages
Getting Started With Scratch Guide - RaspberryPi
PDF
No ratings yet
Getting Started With Scratch Guide - RaspberryPi
122 pages
Bring Your Drawings Into Scratch: Getting Started
PDF
No ratings yet
Bring Your Drawings Into Scratch: Getting Started
3 pages
Drawing Rectangle
PDF
No ratings yet
Drawing Rectangle
2 pages
Scratch Booklet
PDF
No ratings yet
Scratch Booklet
22 pages
P SCRATCH 01 Interface
PDF
No ratings yet
P SCRATCH 01 Interface
7 pages
CH 7 INTRO TO SCRATCH - EXERCISES - GRADE 3
PDF
No ratings yet
CH 7 INTRO TO SCRATCH - EXERCISES - GRADE 3
3 pages
Step by Step: Lesson Plan On Scratch Programming: Background
PDF
No ratings yet
Step by Step: Lesson Plan On Scratch Programming: Background
7 pages
Paint Box
PDF
No ratings yet
Paint Box
27 pages
Raspberry Pi Projects For Kids - Second Edition - Sample Chapter
PDF
100% (2)
Raspberry Pi Projects For Kids - Second Edition - Sample Chapter
20 pages
Computer Coding Projects For Kids - A Step-By-Step Visual Guide To Creating Your Own Scratch Projects (PDFDrive) - 20-226
PDF
No ratings yet
Computer Coding Projects For Kids - A Step-By-Step Visual Guide To Creating Your Own Scratch Projects (PDFDrive) - 20-226
207 pages
T Intro Scratch
PDF
No ratings yet
T Intro Scratch
22 pages
Week 2
PDF
No ratings yet
Week 2
25 pages
A.all Blocks of Scratch 0
PDF
No ratings yet
A.all Blocks of Scratch 0
10 pages
Grade 3 & 4 Dec
PDF
No ratings yet
Grade 3 & 4 Dec
42 pages
Scratch Project
PDF
No ratings yet
Scratch Project
4 pages
Ch-4 Scratch Programming
PDF
No ratings yet
Ch-4 Scratch Programming
16 pages
Tutorial Scratch - 02 (Ingles) PDF
PDF
No ratings yet
Tutorial Scratch - 02 (Ingles) PDF
17 pages
CPT2071 - Material - K00958 - 20201104142833 - Introduction To Scratch
PDF
No ratings yet
CPT2071 - Material - K00958 - 20201104142833 - Introduction To Scratch
59 pages
Coding Qa
PDF
No ratings yet
Coding Qa
9 pages
Coding Book Chap 1
PDF
No ratings yet
Coding Book Chap 1
37 pages
Anon YYYY Learning Outcomes For Scratch-Based Curriculum
PDF
No ratings yet
Anon YYYY Learning Outcomes For Scratch-Based Curriculum
41 pages
Daily Learning Activity: Subject
PDF
No ratings yet
Daily Learning Activity: Subject
2 pages
Motion Blocks
PDF
No ratings yet
Motion Blocks
4 pages
JuanPablo ProgrammingActivities
PDF
No ratings yet
JuanPablo ProgrammingActivities
112 pages
Scratch Getting Started Guide 22f61439 Cf2f 4c6a 8a69 D9453e4eaa13
PDF
No ratings yet
Scratch Getting Started Guide 22f61439 Cf2f 4c6a 8a69 D9453e4eaa13
15 pages
4th Computer (More On Scratch)
PDF
No ratings yet
4th Computer (More On Scratch)
5 pages
Scratch Programming: Scratch Is A Programming Language That Makes It Easy To Create
PDF
No ratings yet
Scratch Programming: Scratch Is A Programming Language That Makes It Easy To Create
10 pages
Scratch4 - Chatbot
PDF
No ratings yet
Scratch4 - Chatbot
20 pages
UWB Arduino Pro Mini
PDF
No ratings yet
UWB Arduino Pro Mini
1 page
Scratch3 0tello-EN
PDF
No ratings yet
Scratch3 0tello-EN
9 pages
ScratchReferenceGuide PDF
PDF
No ratings yet
ScratchReferenceGuide PDF
17 pages
Scratch3 - Ghostbusters
PDF
No ratings yet
Scratch3 - Ghostbusters
19 pages
Scratch 1
PDF
No ratings yet
Scratch 1
15 pages
Preview Mission SC Final - 3
PDF
No ratings yet
Preview Mission SC Final - 3
6 pages
Scratchreferenceguide 14
PDF
No ratings yet
Scratchreferenceguide 14
23 pages
Scratchreferenceguide 14
PDF
No ratings yet
Scratchreferenceguide 14
23 pages
Welcome To My World
PDF
No ratings yet
Welcome To My World
37 pages