Paint Program on Scratch
In this project, you will be create your own paint program with Scratch 3.0!
The project creates a coloring palette for you to make your own drawing. You can change the colour of the pencil, clear the screen, erase the mistakes and much more!
What you’ll Learn:
Let’s start by creating a pencil, that can be used to draw on the stage.
As you will be using the mouse to draw, you will want the pen to always follow the mouse. whenever the mouse button is down the pen should be down, and when it is up the pen should be up.
Tip: Have you noticed that it’s the centre of the pen, and not the tip, that follows the mouse pointer?
To fix this, click on your pencil sprite, and drag the pencil to ‘Set costume center’.
Test your code again. Move the pen around the stage and hold down the mouse button. Can you draw with your pen.
Let’s draw with some different colours, and allow the user to choose between them!
Click on your pencil sprite, click ‘Costumes’ and duplicate your ‘pencil-blue’ costume and create different color pencil costume of your choice.
We’ll add some sprites at the side of the work area. The sprites will look like color block. If we click on a color block, it will change the colour of the line we draw and also change the colour of the pencil sprite costume.
Rename the Color block sprites so that they are called ‘blue’, ‘green’, Red, yellow and so on…
For Example, If the Green color block is clicked, it should broadcast the “Green” message to pencil sprite. The pencil sprite should listen for the “Green” message and change its costume and pencil colour in response.
Then add similar code to other color block so that Pencil sprite can switch the pencil line colour and its costume.
Finally, add the code to tell the pencil sprite which colour to start with, and to make sure that the screen is clear when your program started. (i.e, When Green Flag Clicked).
Sometimes mistakes happen, so add a ‘clear’ button and an eraser button.
If Eraser sprite clicked, it broadcast the message “Erase” to Pencil Sprite. 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!
Add the ‘X-block’ sprite from the library’s letters section. This sprite is the ‘clear’ button.When the ‘X-block’ sprite is clicked, it clear the Stage.
Make the program more interesting by allowing the person using your program to draw things with different pen widths.
Create a Variable named Width, set the pen size to width instead of particular number. You can now drag the slider that is visible on the stage to change the pencil size.
To download the project files of the project Paint Program with Scratch 3.0 Click here. Also go through the another ineresting scratch 3.0 project of Animate Your Name using scratch 3.0 here,
Here's a step-by-step tutorial to create a platformer game similar to Super Mario in Scratch:…
Here's a step-by-step tutorial to create a Whack-a-Mole game in Scratch with code snippets: 1.…
About Game: In Spot The Difference Game, the player has to spot the difference between…
In this scratch tutorial, you will create a memory game in which you have to…
In this article, we are going to teach you how to program your owncustomized version…
About Duck Hunt Game: This is a remake of the classic video game Duck Hunt.…
This website uses cookies.
View Comments
I KNOW THAT HOW THAT