{"id":1499,"date":"2021-09-22T08:55:19","date_gmt":"2021-09-22T15:55:19","guid":{"rendered":"https:\/\/lbmslab.org\/lab\/?page_id=1499"},"modified":"2021-09-23T22:02:27","modified_gmt":"2021-09-24T05:02:27","slug":"mouse-maze-ii","status":"publish","type":"page","link":"https:\/\/lbmslab.org\/lab\/mouse-maze-ii\/","title":{"rendered":"Mouse Maze (Part 2)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/lbmslab.org\/lab\/mouse-maze-part-1\/\" data-type=\"page\" data-id=\"1469\">Part 1 is here.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Resize and position the mouse<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we&#8217;ve got some working controls, let&#8217;s make the mouse fit our maze and put him in his starting position.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add these blocks to the top of the direction controls for the mouse:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.23.09-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"218\" height=\"116\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.23.09-AM.png\" alt=\"\" class=\"wp-image-1500\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Make the mouse sense walls<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are a lot of different ways to get a sprite to see the walls of the maze. We&#8217;re going to do it by making the maze walls black and telling the mouse to return to the start when he touches that color.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add this code to make the mouse react to black:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.24.05-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"294\" height=\"230\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.24.05-AM.png\" alt=\"\" class=\"wp-image-1501\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Draw the maze<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.24.28-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"180\" height=\"226\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.24.28-AM.png\" alt=\"\" class=\"wp-image-1503\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">on the bottom right of the screen, find the background controls and choose the paint icon.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM-1024x576.png\" alt=\"\" class=\"wp-image-1504\" srcset=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM-1024x576.png 1024w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM-300x169.png 300w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM-768x432.png 768w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM-1536x864.png 1536w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.25.25-AM.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Draw a simple maze. You might need to edit it a few times to make sure the mouse can get through without touching a wall.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Make your cheese<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Select the paint a new sprite icon.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.28.10-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"158\" height=\"230\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.28.10-AM.png\" alt=\"\" class=\"wp-image-1505\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Draw your cheese!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM-1024x576.png\" alt=\"\" class=\"wp-image-1506\" srcset=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM-1024x576.png 1024w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM-300x169.png 300w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM-768x432.png 768w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM-1536x864.png 1536w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.30-AM.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Your cheese will probably be too big, and in the wrong place.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.49-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.49-AM-1024x545.png\" alt=\"\" class=\"wp-image-1507\" srcset=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.49-AM-1024x545.png 1024w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.49-AM-300x160.png 300w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.49-AM-768x409.png 768w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.29.49-AM.png 1250w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>That&#8217;s a big cheese<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Add code TO THE CHEESE SPRITE, NOT THE MOUSE to make the cheese get smaller move to the correct location. This is what worked for me. Your numbers might be different.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.31.04-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"237\" height=\"170\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.31.04-AM.png\" alt=\"\" class=\"wp-image-1508\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now my mouse is at one side of the maze, and my cheese is at the other.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.31.11-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"374\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.31.11-AM.png\" alt=\"\" class=\"wp-image-1509\" srcset=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.31.11-AM.png 492w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.31.11-AM-300x228.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We need to add some code to make the mouse react when he touches the cheese. Add the controls to the mouse sensing code.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.52.27-AM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"279\" height=\"365\" src=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.52.27-AM.png\" alt=\"\" class=\"wp-image-1511\" srcset=\"https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.52.27-AM.png 279w, https:\/\/lbmslab.org\/lab\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-22-at-8.52.27-AM-229x300.png 229w\" sizes=\"auto, (max-width: 279px) 100vw, 279px\" \/><\/a><figcaption>Can you figure out how to add the Goal Cheer sound?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now we have a working maze! But the same one repeats over and over. Can you figure out how to add multiple mazes?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/lbmslab.org\/lab\/mouse-maze-part-3\/\" data-type=\"page\" data-id=\"1520\">Part 3: Multiple mazes! More colors! And stopping cheating!<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 1 is here. Resize and position the mouse Now that we&#8217;ve got some working controls, let&#8217;s make the mouse fit our maze and put him in his starting position. Add these blocks to the top of the direction controls for the mouse: Make the mouse sense walls There are a lot of different ways [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-1499","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/pages\/1499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/comments?post=1499"}],"version-history":[{"count":8,"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/pages\/1499\/revisions"}],"predecessor-version":[{"id":1539,"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/pages\/1499\/revisions\/1539"}],"wp:attachment":[{"href":"https:\/\/lbmslab.org\/lab\/wp-json\/wp\/v2\/media?parent=1499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}