{"id":6796,"date":"2022-03-31T09:45:55","date_gmt":"2022-03-31T09:45:55","guid":{"rendered":"https:\/\/brightchamps.com\/blog\/?p=6796"},"modified":"2023-12-18T13:53:49","modified_gmt":"2023-12-18T13:53:49","slug":"make-pathfinding-game-in-scratch","status":"publish","type":"post","link":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/","title":{"rendered":"How To Make A Simple Pathfinding Game In Scratch"},"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>How To Make A Simple Pathfinding Game In Scratch<\/strong><\/span><\/span><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Scratch makes it pretty simple to learn coding logic and concepts through the creation of games. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today we are going to create another <a href=\"https:\/\/brightchamps.com\/blog\/best-scratch-games\/\">game in Scratch<\/a>, to understand its blocks and coding a little better.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Are you curious about what it is?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well, I will show you how to make a simple <strong>Pathfinding Game in <a href=\"https:\/\/brightchamps.com\/blog\/guides\/scratch-programming\/\">Scratch<\/a><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this game, we&#8217;ll make the sprite move to the goal by following some paths within a maze. We will learn about cloning and creating a new function (using &#8220;my block&#8221; in this game).&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Take a look at the image below to see how the <a href=\"https:\/\/brightchamps.com\/blog\/make-scratch-extension-using-javascript\/\">game<\/a> appears.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img fetchpriority=\"high\" fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-1.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6797\" width=\"707\" height=\"533\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-1.png 707w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-1-480x361.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 707px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Learn more about <a href=\"https:\/\/brightchamps.com\/blog\/scratch-coding-for-kids\/\">scratch coding for kids<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us begin!<\/p>\n\n\n\n<div class=\"wp-block-yoast-seo-table-of-contents yoast-table-of-contents\"><h2>Table of contents<\/h2><ul><li><a href=\"#h-how-to-make-a-simple-pathfinding-game-in-scratch\" data-level=\"2\">How to Make a Simple Pathfinding Game in Scratch&nbsp;<\/a><ul><li><a href=\"#h-draw-the-sprites\" data-level=\"3\">Draw The Sprites&nbsp;&nbsp;<\/a><\/li><li><a href=\"#h-codes-for-the-path\" data-level=\"3\">Codes For The Path&nbsp;&nbsp;<\/a><\/li><li><a href=\"#h-codes-for-the-cat\" data-level=\"3\">Codes For The Cat&nbsp;&nbsp;<\/a><\/li><\/ul><\/li><\/ul><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-make-a-simple-pathfinding-game-in-scratch\"><strong>How to Make a Simple Pathfinding Game in Scratch&nbsp;<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So here we need a <a href=\"https:\/\/brightchamps.com\/blog\/control-character-with-wasd-in-scratch-repetition-conditionals\/\">maze<\/a>, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing the sprites.&nbsp;<\/p>\n\n\n<div id=\"cstm_banner_cta\"><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-draw-the-sprites\"><strong>Draw The Sprites&nbsp;&nbsp;<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Maze&nbsp;<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s start to make the border of the maze using the rectangle tool.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-2-1024x293.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6798\" width=\"768\" height=\"220\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now give some lines on it to make it look like a maze.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-3-1024x732.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6799\" width=\"768\" height=\"549\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Paths&nbsp;<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Draw a 7&#215;7 square (so the size is around 28&#215;28 pixels) and set it with no outline and give any color for the fill color.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-4-1024x695.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6800\" width=\"768\" height=\"521\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Draw a line and a square to make the arrow (for the direction of the path)&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-5-1024x687.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6801\" width=\"768\" height=\"515\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Convert the square shape to a triangle by using reshape tool<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-6-1024x431.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6802\" width=\"768\" height=\"323\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Rotate the triangle, until it looks like a perfect arrow<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-7-1024x356.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6803\" width=\"768\" height=\"267\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-codes-for-the-path\"><strong>Codes For The Path&nbsp;&nbsp;<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Set the position of the path&nbsp;&nbsp;<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">First and foremost, we must adjust the size and position of the star to any position that we wish to use as the finish point.&nbsp;<\/p>\n\n\n\n\n\n<p class=\"wp-block-paragraph\">Then, set the path&#8217;s position to the same as the star&#8217;s and set it to the back layer (so it doesn&#8217;t appear in front of the star).&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then, set the direction to 0 (because we want to be able to change the direction in any direction, let&#8217;s start at 0 degrees).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-8-1024x341.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6804\" width=\"768\" height=\"256\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create path clones&nbsp;&nbsp;<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Arrange these codes so that the path above has only one direction.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-9-1024x321.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6805\" width=\"768\" height=\"241\"\/><\/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>(Note: Ignore the position of the star, I moved it just to show the clone)&nbsp;<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">To make the other directions, we have to repeat it 4 times and change the direction to 90 degrees.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-10-1024x416.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6806\" width=\"768\" height=\"312\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To make it not overlap the maze line, we have to give the conditional block. Now it won\u2019t overlap the black line.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-11-1024x415.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6807\" width=\"768\" height=\"311\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Make those \u201cmaking clone\u201d codes as a function, so we can reuse the block only using one block<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-12-1024x411.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6808\" width=\"768\" height=\"308\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Make the clones keep cloning itself&nbsp;&nbsp;<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To make the clones keep duplicating themselves, we have to use that \u201cpath in any direction\u201d block when it starts as a clone. So every clone will make new clones<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-13-1024x406.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6809\" width=\"768\" height=\"305\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Duplicate the costume and give 4 different colors (no need to change the direction only the color). Then name it (0 for 0 degrees, 90 for 90 degrees, and so on)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-14-1024x219.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6810\" width=\"768\" height=\"164\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then put the \u201cnext costume\u201d block in the \u201cpath in any direction\u201d code, now it will have a different color for each direction.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-15-1024x420.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6811\" width=\"768\" height=\"315\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-codes-for-the-cat\"><strong>Codes For The Cat&nbsp;&nbsp;<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Change direction when it steps on the arrow filled path&nbsp;<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">We need to put 4 if-else blocks because there are four colors for each direction. And give the condition \u201ctouching color\u201d for each of them.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the color using the eyedropper tool and click on the color of each path.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-16-1024x538.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6812\" width=\"768\" height=\"404\"\/><figcaption class=\"wp-element-caption\">Eyedropper tool&nbsp;<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Because the cat is too big to detect the color, let\u2019s make it detect only in the center of the cat.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make one dot in a new costume as the detector. Make sure it is in the center of the costume stage.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-17-1024x533.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6813\" width=\"768\" height=\"400\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Make a new function for changing direction using a detector costume. Then change it back to the original costume. To make it forever moving, don\u2019t forget the forever <a href=\"https:\/\/brightchamps.com\/blog\/scratch-loops\/\">loop<\/a>.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-18.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6814\" width=\"566\" height=\"628\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-18.png 566w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-18-480x532.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 566px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">But now the problem is the cat changes its direction too suddenly. It causes the cat always overlap the maze line.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-19.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6815\" width=\"743\" height=\"566\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So let\u2019s move it smoothly.&nbsp;First, we have to make a direction <a href=\"https:\/\/brightchamps.com\/blog\/types-of-variables-in-scratch\/\">variable<\/a> to store it in a variable because we want to change it later. Replace all the \u201cpoint in direction\u201d blocks to \u201cset variable direction\u201d blocks.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-20.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6816\" width=\"620\" height=\"627\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-20.png 620w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-20-480x486.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 620px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of \u201cpoint in direction\u201d now we have to change it to \u201cturn\u201d because we want to make it turns smoothly.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the direction, we use the \u201cturn left\u201d block for the smooth turn effect we use the \u201cturn right\u201d block and give a small number to make it turn smoothly.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-21.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6817\" width=\"650\" height=\"599\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-21.png 650w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-21-480x442.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 650px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Voila! Now the cat turns smoothly when it changes its direction because it has a small&nbsp; degree while turning<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Done! Now your cat will automatically follow the paths to go to the star!&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-22.png\" alt=\"How To Make A Simple Pathfinding Game In Scratch\" class=\"wp-image-6818\" width=\"662\" height=\"514\" srcset=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-22.png 662w, https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch-22-480x373.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 662px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Making games in Scratch is a lot of fun, and you learn a lot about coding as you go.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, after creating this path-finding game, you will have gained <a href=\"https:\/\/brightchamps.com\/blog\/coding-benefits-for-kids\/\">knowledge of coding<\/a> concepts such as variables, loops, and so on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Continue making fun games and projects in Scratch, and you&#8217;ll be a pro coder in no time.<\/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\">Coding games for kids are interactive and enjoyable activities that introduce young learners to the world of programming. Check out<a href=\"https:\/\/brightchamps.com\/blog\/coding-game-for-kids\/\"> coding game for kids<\/a>.<\/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\"><strong>Frequently Asked Questions (FAQs)<\/strong><\/p>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1648712606328\"><strong class=\"schema-faq-question\"><strong>Why do you move the path sprite 30 steps while it is cloning?<\/strong><\/strong> <p class=\"schema-faq-answer\">Because the path box is approximately 28 pixels in size, we&#8217;ll leave a small space between them. Then I select 30 pixels (which must be bigger than the size).<br\/><\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1648712628766\"><strong class=\"schema-faq-question\"><strong>Why do we need to save the cat&#8217;s direction in a variable?<\/strong><\/strong> <p class=\"schema-faq-answer\">We want to distinguish between &#8220;variable direction&#8221; and &#8220;cat&#8217;s direction.&#8221; As a result, we can change the direction variable without affecting the cat&#8217;s direction.<br\/><\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1648712646482\"><strong class=\"schema-faq-question\"><strong>Why does it have to be &#8220;turn left&#8221; to set the cat&#8217;s direction?<\/strong><\/strong> <p class=\"schema-faq-answer\">I&#8217;ll give you an example to help you understand:<br\/>The cat is pointing to the right at first (direction = 90 degrees). If we want to move it to the right, we must turn it 90 degrees to the left.<br\/>The calculation is as follows:<br\/>Cat turns = cat current direction + turning degree = 90 (it points to the right at first) + (-90 (because &#8220;turn left&#8221; is a negative degree)) = 0 (it won&#8217;t turn), so it still points to the right.<br\/>Then it turns right, causing it to turn in the opposite direction.<br\/><\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Scratch makes it pretty simple to learn coding logic and concepts through the creation of games. Today we are going to create another game in Scratch, to understand its blocks and coding a little better.&nbsp; Are you curious about what it is? Well, I will show you how to make a simple Pathfinding Game in [&hellip;]<\/p>\n","protected":false},"author":51,"featured_media":6819,"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-6796","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>How To Make A Simple Pathfinding Game In Scratch - BrightChamps Blog<\/title>\n<meta name=\"description\" content=\"To Make a Simple Pathfinding Game in Scratch we need a maze, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing\" \/>\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\/make-pathfinding-game-in-scratch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Make A Simple Pathfinding Game In Scratch - BrightChamps Blog\" \/>\n<meta property=\"og:description\" content=\"To Make a Simple Pathfinding Game in Scratch we need a maze, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing\" \/>\n<meta property=\"og:url\" content=\"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-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-31T09:45:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-18T13:53:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-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=\"Khadijah Sakinah\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khadijah Sakinah\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/\"},\"author\":{\"name\":\"Khadijah Sakinah\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#\\\/schema\\\/person\\\/6a50154fa18e7e75ffd108d2ce7f9c1a\"},\"headline\":\"How To Make A Simple Pathfinding Game In Scratch\",\"datePublished\":\"2022-03-31T09:45:55+00:00\",\"dateModified\":\"2023-12-18T13:53:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/\"},\"wordCount\":1150,\"publisher\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png\",\"keywords\":[\"CodeChamps\"],\"articleSection\":[\"Code for Kids Corner\"],\"inLanguage\":\"en-US\",\"accessibilityFeature\":[\"tableOfContents\"]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/\",\"name\":\"How To Make A Simple Pathfinding Game In Scratch - BrightChamps Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png\",\"datePublished\":\"2022-03-31T09:45:55+00:00\",\"dateModified\":\"2023-12-18T13:53:49+00:00\",\"description\":\"To Make a Simple Pathfinding Game in Scratch we need a maze, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712606328\"},{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712628766\"},{\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712646482\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png\",\"contentUrl\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png\",\"width\":2100,\"height\":1185,\"caption\":\"How To Make A Simple Pathfinding Game In Scratch\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-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\":\"How To Make A Simple Pathfinding Game In Scratch\"}]},{\"@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\\\/6a50154fa18e7e75ffd108d2ce7f9c1a\",\"name\":\"Khadijah Sakinah\",\"description\":\"\u2b50\u2b50\u2b50\u2b50\u2b50 I am a physics teacher by trade, but I am currently interested in coding. My goal at BrightChamps is to improve students' critical and creative thinking skills through coding. Learn from Me\",\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/author\\\/khadijahsakinah\\\/\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712606328\",\"position\":1,\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712606328\",\"name\":\"Why do you move the path sprite 30 steps while it is cloning?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Because the path box is approximately 28 pixels in size, we'll leave a small space between them. Then I select 30 pixels (which must be bigger than the size).<br\\\/>\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712628766\",\"position\":2,\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712628766\",\"name\":\"Why do we need to save the cat's direction in a variable?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"We want to distinguish between \\\"variable direction\\\" and \\\"cat's direction.\\\" As a result, we can change the direction variable without affecting the cat's direction.<br\\\/>\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712646482\",\"position\":3,\"url\":\"https:\\\/\\\/brightchamps.com\\\/blog\\\/make-pathfinding-game-in-scratch\\\/#faq-question-1648712646482\",\"name\":\"Why does it have to be \\\"turn left\\\" to set the cat's direction?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"I'll give you an example to help you understand:<br\\\/>The cat is pointing to the right at first (direction = 90 degrees). If we want to move it to the right, we must turn it 90 degrees to the left.<br\\\/>The calculation is as follows:<br\\\/>Cat turns = cat current direction + turning degree = 90 (it points to the right at first) + (-90 (because \\\"turn left\\\" is a negative degree)) = 0 (it won't turn), so it still points to the right.<br\\\/>Then it turns right, causing it to turn in the opposite direction.<br\\\/>\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Make A Simple Pathfinding Game In Scratch - BrightChamps Blog","description":"To Make a Simple Pathfinding Game in Scratch we need a maze, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing","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\/make-pathfinding-game-in-scratch\/","og_locale":"en_US","og_type":"article","og_title":"How To Make A Simple Pathfinding Game In Scratch - BrightChamps Blog","og_description":"To Make a Simple Pathfinding Game in Scratch we need a maze, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing","og_url":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/","og_site_name":"BrightChamps Blog","article_publisher":"https:\/\/www.facebook.com\/BrightChamps-101266664954230\/","article_published_time":"2022-03-31T09:45:55+00:00","article_modified_time":"2023-12-18T13:53:49+00:00","og_image":[{"width":2100,"height":1185,"url":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png","type":"image\/png"}],"author":"Khadijah Sakinah","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Khadijah Sakinah","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#article","isPartOf":{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/"},"author":{"name":"Khadijah Sakinah","@id":"https:\/\/brightchamps.com\/blog\/#\/schema\/person\/6a50154fa18e7e75ffd108d2ce7f9c1a"},"headline":"How To Make A Simple Pathfinding Game In Scratch","datePublished":"2022-03-31T09:45:55+00:00","dateModified":"2023-12-18T13:53:49+00:00","mainEntityOfPage":{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/"},"wordCount":1150,"publisher":{"@id":"https:\/\/brightchamps.com\/blog\/#organization"},"image":{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#primaryimage"},"thumbnailUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png","keywords":["CodeChamps"],"articleSection":["Code for Kids Corner"],"inLanguage":"en-US","accessibilityFeature":["tableOfContents"]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/","url":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/","name":"How To Make A Simple Pathfinding Game In Scratch - BrightChamps Blog","isPartOf":{"@id":"https:\/\/brightchamps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#primaryimage"},"image":{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#primaryimage"},"thumbnailUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png","datePublished":"2022-03-31T09:45:55+00:00","dateModified":"2023-12-18T13:53:49+00:00","description":"To Make a Simple Pathfinding Game in Scratch we need a maze, paths, the goal, and a sprite that moves to it. As usual, let\u2019s start by drawing","breadcrumb":{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712606328"},{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712628766"},{"@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712646482"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#primaryimage","url":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png","contentUrl":"https:\/\/brightchamps.com\/blog\/wp-content\/uploads\/2022\/03\/How-To-Make-A-Simple-Pathfinding-Game-In-Scratch.png","width":2100,"height":1185,"caption":"How To Make A Simple Pathfinding Game In Scratch"},{"@type":"BreadcrumbList","@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-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":"How To Make A Simple Pathfinding Game In Scratch"}]},{"@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\/6a50154fa18e7e75ffd108d2ce7f9c1a","name":"Khadijah Sakinah","description":"\u2b50\u2b50\u2b50\u2b50\u2b50 I am a physics teacher by trade, but I am currently interested in coding. My goal at BrightChamps is to improve students' critical and creative thinking skills through coding. Learn from Me","url":"https:\/\/brightchamps.com\/blog\/author\/khadijahsakinah\/"},{"@type":"Question","@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712606328","position":1,"url":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712606328","name":"Why do you move the path sprite 30 steps while it is cloning?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Because the path box is approximately 28 pixels in size, we'll leave a small space between them. Then I select 30 pixels (which must be bigger than the size).<br\/>","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712628766","position":2,"url":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712628766","name":"Why do we need to save the cat's direction in a variable?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"We want to distinguish between \"variable direction\" and \"cat's direction.\" As a result, we can change the direction variable without affecting the cat's direction.<br\/>","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712646482","position":3,"url":"https:\/\/brightchamps.com\/blog\/make-pathfinding-game-in-scratch\/#faq-question-1648712646482","name":"Why does it have to be \"turn left\" to set the cat's direction?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I'll give you an example to help you understand:<br\/>The cat is pointing to the right at first (direction = 90 degrees). If we want to move it to the right, we must turn it 90 degrees to the left.<br\/>The calculation is as follows:<br\/>Cat turns = cat current direction + turning degree = 90 (it points to the right at first) + (-90 (because \"turn left\" is a negative degree)) = 0 (it won't turn), so it still points to the right.<br\/>Then it turns right, causing it to turn in the opposite direction.<br\/>","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts\/6796","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\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/comments?post=6796"}],"version-history":[{"count":6,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts\/6796\/revisions"}],"predecessor-version":[{"id":22392,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/posts\/6796\/revisions\/22392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/media\/6819"}],"wp:attachment":[{"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/media?parent=6796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/categories?post=6796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brightchamps.com\/blog\/wp-json\/wp\/v2\/tags?post=6796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}