{"id":6854,"date":"2022-03-31T11:28:51","date_gmt":"2022-03-31T11:28:51","guid":{"rendered":"https:\/\/brightchamps.com\/blog\/?p=6854"},"modified":"2024-10-01T11:12:05","modified_gmt":"2024-10-01T11:12:05","slug":"repeat-if-else-blocks-in-scratch","status":"publish","type":"post","link":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/","title":{"rendered":"Understanding Repeat and If\/Else Blocks In Scratch With  Chase The Mouse Game and Draw Polygons"},"content":{"rendered":"<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/brightchamps.com\/blog\/\">Home<\/a><\/span> \u00bb <span><a href=\"https:\/\/brightchamps.com\/blog\/code-for-kids\/\">Code for Kids Corner<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\"><strong>Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons<\/strong><\/span><\/span><\/div>\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/brightchamps.com\/blog\/guides\/scratch-programming\/\">Scratch platform<\/a> is well-known for its ease of use and accessibility. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Scratch has become extremely popular around the world as a result of both of these factors, and it continues to be a favorite coding platform among both children and teachers.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Scratch&#8217;s popularity stems from the fact that the platform allows you to create a wide range of <a href=\"https:\/\/brightchamps.com\/blog\/spot-the-difference-game-scratch\/\">projects and games<\/a>.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/02\/Free-Kids-Coding-Resources-1024x512.jpg\" alt=\"Scratch Coding\" class=\"wp-image-4006\" width=\"768\" height=\"384\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>If you have a creative vision, there is no limit to your creativity in Scratch.<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Scratch uses block-based coding and today, we&#8217;ll go over the <strong>Repeat and If\/Else Blocks in Scratch<\/strong> by making two games: chase the mouse and draw polygons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s get right into it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-chase-the-mouse-game-in-scratch\"><strong>Chase The Mouse Game in Scratch&nbsp;<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add a sprite cat and mouse &#8211; click on choose a sprite and search for cat and mouse sprite.&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"502\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-1-1024x502.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6856\" style=\"width:768px;height:377px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-1-1024x502.png 1024w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-1-980x481.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-1-480x235.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Choose the cat and mouse sprite:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"845\" height=\"270\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-2.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6857\" style=\"width:634px;height:203px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-2.png 845w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-2-480x153.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 845px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Choose a background that suits the sprite &#8211; Click on choose a backdrop.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-3-1024x507.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6858\" style=\"width:768px;height:380px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-3-1024x507.png 1024w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-3-980x485.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-3-480x237.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Pick a backdrop of your wish to make the project more attractive. Say woods&nbsp; for example,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"490\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-4-1024x490.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6859\" style=\"width:768px;height:368px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-4-980x469.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-4-480x230.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code for Sprite Mouse:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Let\u2019s make the mouse move along with the mouse pointer and stay away from the cat.&nbsp;<\/li>\n\n\n\n<li>When the project starts the mouse has to move continuously (forever).&nbsp;<\/li>\n\n\n\n<li>To avoid the glitch while the mouse pointer touches over the mouse an <strong>if condition<\/strong> is used to make the mouse move only when it stays a little away from the cursor\/mouse pointer.&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"707\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-5-1024x707.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6860\" style=\"width:768px;height:530px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-5-1024x707.png 1024w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-5-980x677.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-5-480x331.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Explanation:&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The project starts when is clicked.&nbsp;<\/li>\n\n\n\n<li>To make the mouse move continuously the <strong>forever block<\/strong> is used from control.<\/li>\n\n\n\n<li>To avoid the glitch when the pointer stays on the mouse an <strong>If condition<\/strong> is used, which makes the mouse move only when the pointer stays away from the mouse.&nbsp;<\/li>\n\n\n\n<li>The mouse follows the mouse pointer\/cursor when the <a href=\"https:\/\/brightchamps.com\/blog\/customize-blocks-in-scratch\/\">block<\/a>, point towards mouse pointer is added.&nbsp;<\/li>\n\n\n\n<li>The <strong>move block<\/strong> makes the mouse move.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code for Sprite Cat<\/strong> :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As the name of the project suggests we want the cat to follow the mouse.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"976\" height=\"723\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-6.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6861\" style=\"width:732px;height:542px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-6.png 976w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-6-480x356.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 976px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Explanation:&nbsp;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The project starts when is clicked.&nbsp;<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/brightchamps.com\/blog\/create-start-screen-in-scratch\/\">Repeat<\/a> block <\/strong>helps to continue the movement with a condition, which means when the space key is pressed it makes the cat stop moving.&nbsp;<\/li>\n\n\n\n<li>The <strong>point towards<\/strong> mouse makes the cat follows the mouse.<\/li>\n<\/ul>\n\n\n<div id=\"cstm_banner_cta\"><\/div>\n\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Making a Game with little modifications<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we know how to make the cat chase the mouse, let\u2019s make it more interesting by adding a few more blocks for cat sprite.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add a variable score, so that every time the cat touches the mouse it will add a score.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"728\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-7.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6862\" style=\"width:564px;height:546px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-7.png 752w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-7-480x465.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 752px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Explanation:&nbsp;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Go to the variable category, click on make a<strong> <\/strong><a href=\"https:\/\/brightchamps.com\/blog\/confirm-and-verify-scratch-account\/\"><strong>variable<\/strong><\/a><strong>.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"435\" height=\"695\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-8.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6863\" style=\"width:326px;height:521px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-8.png 435w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-8-188x300.png 188w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-8-94x150.png 94w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;So every time to start the game we make the score starts with 0, by using the block<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"81\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-9.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6864\" style=\"width:343px;height:61px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-9.png 457w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-9-300x53.png 300w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-9-150x27.png 150w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A condition that helps to sense the cat touching the mouse is used,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"275\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-10-1024x275.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6865\" style=\"width:768px;height:206px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-10-980x263.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-10-480x129.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For every touch of the cat to the mouse, the score has to increase by one, you can also add a sound to make it more fun.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"593\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-11-1024x593.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6866\" style=\"width:768px;height:445px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-11-1024x593.png 1024w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-11-980x568.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-11-480x278.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Draw Polygons in Scratch<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Polygon refers to the 2D shapes which are drawn using a set of line segments, that are connected in such a way that no segments cross.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example,&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"577\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-12.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6867\" style=\"width:585px;height:433px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-12.png 780w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-12-480x355.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 780px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add a Sprite<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s add five sprites of your wish and name them as different shapes that we are going to draw, and then add another sprite that draws, let\u2019s say for example,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"369\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-13-1024x369.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6868\" style=\"width:768px;height:277px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-13-1024x369.png 1024w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-13-980x353.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-13-480x173.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And arrange all the sprites in this order to avoid confusion,<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"827\" height=\"605\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-14.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6869\" style=\"width:620px;height:454px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-14.png 827w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-14-480x351.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 827px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add a Backdrop<\/strong>:<br>Choose any backdrop of your choice which enhances the visibility of drawing shapes. The backdrop chosen here is winter,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"602\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-15-1024x602.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6870\" style=\"width:768px;height:452px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-15-1024x602.png 1024w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-15-980x577.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-15-480x282.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Coding<\/strong>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> Understanding what has to be done before coding will help you make it easy, first understand the shapes and their exterior angle<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"885\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-16.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6871\" style=\"width:458px;height:664px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-16.png 610w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-16-480x696.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 610px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Coding for <\/strong><a href=\"https:\/\/brightchamps.com\/blog\/how-to-animate-sprite-in-scratch\/\"><strong>sprites<\/strong><\/a><strong>:<\/strong> First let\u2019s code all the five shapes, which is a very simple step,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"493\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-17-1024x493.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6872\" style=\"width:768px;height:370px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-17-980x472.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-17-480x231.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now, the sprite that will draw all of the shapes must be coded. This is optional; it simply ensures that the sprite appears only when it is required to draw.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"543\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-18.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6873\" style=\"width:459px;height:407px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-18.png 612w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-18-480x426.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 612px, 100vw\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"421\" height=\"777\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-19.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6874\" style=\"width:316px;height:583px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-19.png 421w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-19-163x300.png 163w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-19-81x150.png 81w\" sizes=\"auto, (max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Explanation:&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Because all sprite shapes must draw the respective shape when broadcasted <strong>when I receive block<\/strong> is used, the position for it to draw the shape is allocated by<strong> go to x block<\/strong>, and the color and size in which the pen must draw must be specified.<\/li>\n\n\n\n<li>Then comes the repeat block for drawing shapes.&nbsp;<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The number of times in repeat represents the number of line segments to be used, and the degree represents the exterior angle, which is mentioned earlier.<\/li>\n\n\n\n<li>For example, because the triangle has three line segments, it says repeat three times; to calculate the exterior angle, simply divide the number of corners in the shape by 360<sup>\u00b0<\/sup>; since the triangle has three corners, 360\/3=120<sup>\u00b0<\/sup>.<\/li>\n\n\n\n<li>The same steps have to be followed for other shapes as well,<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"837\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-20.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6875\" style=\"width:709px;height:628px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-20.png 945w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-20-480x425.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 945px, 100vw\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"826\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-21.png\" alt=\"Understanding Repeat If Else Blocks In Scratch\" class=\"wp-image-6876\" style=\"width:740px;height:620px\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-21.png 987w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-21-980x820.png 980w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch-21-480x402.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 987px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Learning to code in Scratch becomes a lot more enjoyable as you get involved in projects like the ones shown above.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And it only takes a project or two to grasp the concepts of programming with block-based programming languages like Scratch.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If this blog has assisted you in figuring out where and when to use repeat and if\/else blocks in Scratch, make sure to challenge yourself and incorporate them in your next Scratch project.<\/p>\n\n\n<div id=\"cstm_banner_cta\"><\/div>\n\n\n\n\n<p class=\"wp-block-paragraph\">Learn Scratch at BrightChamps with its specially designed curriculum that makes learning programming easy for students in Grade 1-12.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">BrightChamps also teaches a variety of other programs that help kids build a foundation in computer programming through activities, interactive lessons, and other means.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To get your hands on more educational and free resources on\u00a0<a href=\"\/\/brightchamps.com\/blog\/kids-coding-languages\/\" target=\"_blank\" rel=\"noreferrer noopener\">coding for kids<\/a>, financial education for kids, and\u00a0<a href=\"https:\/\/brightchamps.com\/blog\/ultimate-guide-to-robotics-for-kids\/\">robotics for kids<\/a>\u00a0do check out the\u00a0<a href=\"https:\/\/brightchamps.com\/\">BrightCHAMPS<\/a>\u00a0Page now!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Scratch platform is well-known for its ease of use and accessibility. Scratch has become extremely popular around the world as a result of both of these factors, and it continues to be a favorite coding platform among both children and teachers.&nbsp; Scratch&#8217;s popularity stems from the fact that the platform allows you to create [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":6877,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"1080","footnotes":""},"categories":[49],"tags":[68],"class_list":["post-6854","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-for-kids","tag-codechamps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons - BrightChamps Blog<\/title>\n<meta name=\"description\" content=\"We&#039;ll go over the repeat and if\/else blocks in Scratch by making two games: chase the mouse and draw polygons and better understand their\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons - BrightChamps Blog\" \/>\n<meta property=\"og:description\" content=\"We&#039;ll go over the repeat and if\/else blocks in Scratch by making two games: chase the mouse and draw polygons and better understand their\" \/>\n<meta property=\"og:url\" content=\"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/\" \/>\n<meta property=\"og:site_name\" content=\"BrightChamps Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BrightChamps-101266664954230\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-31T11:28:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-01T11:12:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2100\" \/>\n\t<meta property=\"og:image:height\" content=\"1185\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sritha V\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sritha V\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"34 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/\"},\"author\":{\"name\":\"Sritha V\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#\\\/schema\\\/person\\\/a157650807faab590a8a7d2347cb0616\"},\"headline\":\"Understanding Repeat and If\\\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons\",\"datePublished\":\"2022-03-31T11:28:51+00:00\",\"dateModified\":\"2024-10-01T11:12:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/\"},\"wordCount\":987,\"publisher\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png\",\"keywords\":[\"CodeChamps\"],\"articleSection\":[\"Code for Kids Corner\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/\",\"name\":\"Understanding Repeat and If\\\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons - BrightChamps Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png\",\"datePublished\":\"2022-03-31T11:28:51+00:00\",\"dateModified\":\"2024-10-01T11:12:05+00:00\",\"description\":\"We'll go over the repeat and if\\\/else blocks in Scratch by making two games: chase the mouse and draw polygons and better understand their\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png\",\"contentUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png\",\"width\":2100,\"height\":1185,\"caption\":\"Understanding Repeat If Else Blocks In Scratch\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/repeat-if-else-blocks-in-scratch\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Code for Kids Corner\",\"item\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/code-for-kids\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Understanding Repeat and If\\\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/\",\"name\":\"BrightChamps Blog\",\"description\":\"BrightChamps Blog, also known as BrightChamps Hub is a go-to resource hub for everything on Coding for kids\",\"publisher\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#organization\",\"name\":\"BrightChamps\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/BrightCHAMPS-logo-new-1.png\",\"contentUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/BrightCHAMPS-logo-new-1.png\",\"width\":417,\"height\":80,\"caption\":\"BrightChamps\"},\"image\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/BrightChamps-101266664954230\\\/\",\"https:\\\/\\\/www.instagram.com\\\/brightchamps\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/brightchamps\\\/mycompany\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UC_Afe_rMGoK5Bs4nSt8QIzQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#\\\/schema\\\/person\\\/a157650807faab590a8a7d2347cb0616\",\"name\":\"Sritha V\",\"description\":\"\u2b50\u2b50\u2b50\u2b50\u2b50 I am an enthusiastic and passionate teacher who enjoys teaching and interacting with students. I enjoy writing as a hobby because it helps me focus and learn something new every time. Through BrightChamps, I hope to lead children to become passionate tech innovators. Learn from Me\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/author\\\/srithav\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons - BrightChamps Blog","description":"We'll go over the repeat and if\/else blocks in Scratch by making two games: chase the mouse and draw polygons and better understand their","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons - BrightChamps Blog","og_description":"We'll go over the repeat and if\/else blocks in Scratch by making two games: chase the mouse and draw polygons and better understand their","og_url":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/","og_site_name":"BrightChamps Blog","article_publisher":"https:\/\/www.facebook.com\/BrightChamps-101266664954230\/","article_published_time":"2022-03-31T11:28:51+00:00","article_modified_time":"2024-10-01T11:12:05+00:00","og_image":[{"width":2100,"height":1185,"url":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png","type":"image\/png"}],"author":"Sritha V","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sritha V","Est. reading time":"34 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#article","isPartOf":{"@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/"},"author":{"name":"Sritha V","@id":"https:\/\/brightchamps.com\/blog\/#\/schema\/person\/a157650807faab590a8a7d2347cb0616"},"headline":"Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons","datePublished":"2022-03-31T11:28:51+00:00","dateModified":"2024-10-01T11:12:05+00:00","mainEntityOfPage":{"@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/"},"wordCount":987,"publisher":{"@id":"https:\/\/brightchamps.com\/blog\/#organization"},"image":{"@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#primaryimage"},"thumbnailUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png","keywords":["CodeChamps"],"articleSection":["Code for Kids Corner"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/","url":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/","name":"Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons - BrightChamps Blog","isPartOf":{"@id":"https:\/\/brightchamps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#primaryimage"},"image":{"@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#primaryimage"},"thumbnailUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png","datePublished":"2022-03-31T11:28:51+00:00","dateModified":"2024-10-01T11:12:05+00:00","description":"We'll go over the repeat and if\/else blocks in Scratch by making two games: chase the mouse and draw polygons and better understand their","breadcrumb":{"@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#primaryimage","url":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png","contentUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/Understanding-Repeat-If-Else-Blocks-In-Scratch.png","width":2100,"height":1185,"caption":"Understanding Repeat If Else Blocks In Scratch"},{"@type":"BreadcrumbList","@id":"https:\/\/brightchamps.com\/blog\/repeat-if-else-blocks-in-scratch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/brightchamps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Code for Kids Corner","item":"https:\/\/brightchamps.com\/blog\/code-for-kids\/"},{"@type":"ListItem","position":3,"name":"Understanding Repeat and If\/Else Blocks In Scratch With Chase The Mouse Game and Draw Polygons"}]},{"@type":"WebSite","@id":"https:\/\/brightchamps.com\/blog\/#website","url":"https:\/\/brightchamps.com\/blog\/","name":"BrightChamps Blog","description":"BrightChamps Blog, also known as BrightChamps Hub is a go-to resource hub for everything on Coding for kids","publisher":{"@id":"https:\/\/brightchamps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/brightchamps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/brightchamps.com\/blog\/#organization","name":"BrightChamps","url":"https:\/\/brightchamps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/brightchamps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2026\/03\/BrightCHAMPS-logo-new-1.png","contentUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2026\/03\/BrightCHAMPS-logo-new-1.png","width":417,"height":80,"caption":"BrightChamps"},"image":{"@id":"https:\/\/brightchamps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BrightChamps-101266664954230\/","https:\/\/www.instagram.com\/brightchamps\/","https:\/\/www.linkedin.com\/company\/brightchamps\/mycompany\/","https:\/\/www.youtube.com\/channel\/UC_Afe_rMGoK5Bs4nSt8QIzQ"]},{"@type":"Person","@id":"https:\/\/brightchamps.com\/blog\/#\/schema\/person\/a157650807faab590a8a7d2347cb0616","name":"Sritha V","description":"\u2b50\u2b50\u2b50\u2b50\u2b50 I am an enthusiastic and passionate teacher who enjoys teaching and interacting with students. I enjoy writing as a hobby because it helps me focus and learn something new every time. Through BrightChamps, I hope to lead children to become passionate tech innovators. Learn from Me","url":"https:\/\/brightchamps.com\/blog\/author\/srithav\/"}]}},"_links":{"self":[{"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts\/6854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/comments?post=6854"}],"version-history":[{"count":5,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts\/6854\/revisions"}],"predecessor-version":[{"id":32426,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts\/6854\/revisions\/32426"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/media\/6877"}],"wp:attachment":[{"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/media?parent=6854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/categories?post=6854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/tags?post=6854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}