<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[2D - Art - Dot Shadows (Difficulty: 2)]]></title><description><![CDATA[<p dir="auto"> </p>
<h2><a class="anchor-offset" name="key-topics-covered"></a>Key Topics Covered</h2>
<ul>
<li><a href="/topic/62/painting-a-costume">Paint Costumes</a></li>
<li><a href="/topic/175/the-pen-extension-part-1">The “Pen” Extension</a></li>
<li><a href="/topic/144/the-touching-block">The Touching Object Block</a></li>
<li><a href="/topic/103/working-with-colors">The “color” Block</a></li>
</ul>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="introduction"></a>Introduction</h2>
<p dir="auto">In this tutorial, you will learn how to make a “dot” version of another sprite, such as a fish:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/53fdd8d3-cdda-4a13-b6fb-38076a3e108d.gif" width="520" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-1-create-a-new-project"></a>Step 1 - Create a New Project</h2>
<p dir="auto">First, please create a new project, remove Sprite1 with Cody, and rename the “Empty1” sprite to “Pen”. Please also add a “Fish” sprite from the library.</p>
<p dir="auto">Your project should look like this:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/33ffe9da-0cf9-4fc1-9cb4-40ea1bbe425f.png" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-2-adjust-the-fish-sprite"></a>Step 2 - Adjust the Fish Sprite</h2>
<p dir="auto">Next, please make the fish sprite larger. You can set its size to 300. Also, please go to its “Costumes” tab and select the “fish-c” costume:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/14778d63-f7fd-4ba4-8936-6c38a2d9fcda.gif" width="1000" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-3-make-the-pen-sprite-a-small-dot"></a>Step 3 - Make the Pen Sprite a Small Dot</h2>
<p dir="auto">Next, select the “Pen” sprite’s costume, and draw a small dot as its costume.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/38fb56b5-9c2e-4415-85ec-7cab5890b4cf.gif" width="800" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-4-add-the-pen-extension"></a>Step 4 - Add the Pen Extension</h2>
<p dir="auto">Now we are ready to add some code. First, please add <a href="/topic/175/the-pen-extension-part-1">the “Pen” extension</a>, then add these 2 blocks to the “Pen” sprite to clear the stage when the project starts:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/2c711432-d10e-4297-899b-8ef4323d590f.png" width="160" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-5-make-the-dot-scan-from-left-to-right"></a>Step 5 - Make the Dot Scan from Left to Right</h2>
<p dir="auto">To scan the entire stage, we need to move the “Pen” sprite to different x positions. To do that, create a new variable “x”, and use a for-loop to make x go from -240 to 240, at a step size of 10. In other words, x will start at -240, then change by 10 to -230, then -200, and keep increasing until it becomes 240.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/83075fb0-5afd-4427-92fc-d35764eb2c50.png" width="400" /></p>
<p dir="auto">Now you should see the dot sliding from left to right:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/89c67be7-398f-46e8-96e6-25db7679b474.gif" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-6-scan-bottom-up"></a>Step 6 - Scan Bottom Up</h2>
<p dir="auto">Instead of scanning only one row, we can make the dot scan the entire stage bottom up as well. We can use another for-loop for and a new variable “y”. Y should go from -180 to 180, also at the step of 10:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/bd607944-59aa-4b8b-a24d-5d907397d75f.png" width="500" /></p>
<p dir="auto">Now for every X position, we make the dot go through all Y positions before we move the dot to the right.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/0385595b-2a16-47bd-904b-72c0ac0ba53d.gif" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-7-draw-a-dot-at-each-position"></a>Step 7 - Draw a Dot at Each Position</h2>
<p dir="auto">Now let’s draw a small dot at each position. First, we need to set the pen’s size to 10, so it draws a circle of size 10. Second, we need to make the pen go down and then go up right after we move it.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/059e1c94-e9d6-41e5-b03d-7bac75cf6e19.png" width="400" /></p>
<p dir="auto">You should get a lot of small dots like this:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/dbde32b4-bd2f-4c85-b7cf-98b13c1f5b65.gif" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-8-make-the-dots-move-faster"></a>Step 8 - Make the Dots Move Faster</h2>
<p dir="auto">It is probably too slow for the dot to completely scan the entire stage. Let’s speed it up by increasing the pen size and step size to a larger number, such as 30:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/c22f8b31-4605-435c-bc3d-3fd1ac1b2314.png" width="400" /></p>
<p dir="auto">Now we get bigger dots, and they can cover the entire stage pretty quickly:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5d3df4ad-4950-4dbf-a813-89125f12570c.gif" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-9-only-draw-dots-under-the-fish"></a>Step 9 - Only Draw Dots Under the Fish</h2>
<p dir="auto">Now we are ready to scan for the fish sprite. We can add a condition that we would only draw a dot if the Pen sprite is touching the Fish sprite, using the <a href="/topic/144/the-touching-block">“touching object” block</a>. To make our scan accurate, you need to set the size of the Pen sprite to a small value like 1.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/14199ed3-060f-46de-adfc-ebb6646604ea.gif" width="900" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-10-skip-screen-refresh"></a>Step 10 - Skip Screen Refresh</h2>
<p dir="auto">To make our program run much faster, we are going to use a very useful technique. Make a new block in the “Pen” sprite called “draw dots”, and select “run without screen refresh”:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/fe3adcfc-ac91-41f3-a31d-281da09da524.png" width="600" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto">Next, move all blocks into this new block’s definition stack. This way, the computer will not update what we see on screen until the “draw dots” stack completes running.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a27d4045-2142-4dff-a214-8277a2c39e27.png" width="700" /></p>
<p dir="auto">Now your project should run much faster:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/021e4436-9d1c-4c95-b398-7d9891d0e8b3.gif" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-11-switch-back-to-smaller-dots"></a>Step 11 - Switch back to smaller dots</h2>
<p dir="auto">To make the dots match the fish better, we can use smaller dots. Since our program runs much faster without screen refreshes, we can afford to use more dots as well. For example, this is what you get when the dot size and the step size are 20:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/d52df134-5ba5-4e4a-b483-bb6f1eba1f1e.png" width="400" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="step-12-set-pen-to-random-colors"></a>Step 12 - Set Pen to Random Colors</h2>
<p dir="auto">For the last step, let’s make our pen color random for each dot. To do that, you need to use the “set pen color” block, and also the <a href="/topic/103/working-with-colors">“color” block</a> to calculate a new random color:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4dcca2b8-2420-49a9-8c44-2c0cd77899f5.png" width="1000" /></p>
<p dir="auto">Here is the final result:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/53fdd8d3-cdda-4a13-b6fb-38076a3e108d.gif" width="520" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="creative-ideas"></a>Creative Ideas</h2>
<p dir="auto">There are many ways you can modify this project with your own creative ideas. Here are some examples:</p>
<ul>
<li>
<p dir="auto"><strong>Different Sprites</strong>: You can replace the fish with any other sprites, such as an animal or some words.</p>
</li>
<li>
<p dir="auto"><strong>Multiple Sprites</strong>: You can make “dot shadows” for multiple sprites. To do that, you just need to change the condition to make a dot when the pen is touching any of those sprites.</p>
</li>
</ul>
]]></description><link>https://forum.creaticode.com/topic/578/2d-art-dot-shadows-difficulty-2</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 05:35:03 GMT</lastBuildDate><atom:link href="https://forum.creaticode.com/topic/578.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Sep 2022 23:06:36 GMT</pubDate><ttl>60</ttl></channel></rss>