{"id":21247,"date":"2020-05-26T11:58:12","date_gmt":"2020-05-26T18:58:12","guid":{"rendered":"https:\/\/www.tynker.com\/blog\/?p=21247"},"modified":"2023-06-15T12:01:20","modified_gmt":"2023-06-15T19:01:20","slug":"the-ar-blocks","status":"publish","type":"post","link":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/","title":{"rendered":"Tynker Toolbox: The AR Blocks"},"content":{"rendered":"\n<p>AR brings coding to life! AR, short for <strong><em>Augmented Reality<\/em><\/strong>, is a way of adding computer-generated effects to real-life photos and videos. And, as an added bonus, AR projects will get you moving around, too! Here\u2019s a look at what\u2019s possible with AR.<\/p>\n\n\n\n<p>Check out <strong>Wipe Away<\/strong>, a timed game where you have to touch on-screen blocks with your hands to win!&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111459\/wipe-away-small.gif\" alt=\"A developer waves his hands around to demonstrate &quot;Wipe Away&quot; AR game\" class=\"wp-image-21248\" width=\"320\" height=\"180\"\/><figcaption class=\"wp-element-caption\">Ready for a serious coding challenge? Check out the <a href=\"https:\/\/www.youtube.com\/watch?v=Cec0qzYFZT4\">video tutorial for Wipe Away!<\/a><\/figcaption><\/figure>\n<\/div>\n\n\n<p>Here\u2019s an AR version of <strong>Space Invaders <\/strong>where you can knock a ball around. Watch it bounce off my head!<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111527\/ar-invaders.gif\" alt=\"An AR version of space invaders\" class=\"wp-image-21249\" width=\"200\" height=\"114\"\/><\/figure>\n<\/div>\n\n\n<p>To get familiar with the AR blocks, let\u2019s make a <strong>Photobooth<\/strong>, where you can take a selfie with a costume of your own design. Here\u2019s what it might look like:<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"200\" height=\"115\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522113708\/bigger-dressup.gif\" alt=\"Demonstration of using costumes with AR blocks, top hat, mustache on a real person's head\" class=\"wp-image-21266\"\/><\/figure>\n<\/div>\n\n\n<p>You can customize your own photobooth with stickers, animations, and more.&nbsp;<br><\/p>\n\n\n\n<p>Let\u2019s start coding one! Follow along by logging in at <strong>tynker.com <\/strong>(or open the app), then create a blank project in Tynker Workshop (<strong>+Create Project &gt; Blank Project<\/strong>). Then, because it\u2019s a Tynker Extension, the AR blocks must be enabled to use. You have two options.&nbsp;<br><\/p>\n\n\n\n<p><strong>Option #1:<\/strong> <strong>&nbsp;<\/strong>Search for an AR command, like <strong>turn video on<\/strong>, then use it in your project. The AR extension will be automatically enabled.&nbsp;<br><\/p>\n\n\n\n<p><strong>Option #2<\/strong>: You can also click <strong>More <\/strong>at the bottom of the coding palette, then choose <strong>AR <\/strong>and <strong>Add<\/strong>.&nbsp;<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69fca287582f6\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #206be5;color:#206be5\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #206be5;color:#206be5\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69fca287582f6\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#Is_This_Thing_On\" >Is This Thing On?&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#Photobooth_Funbooth\" >Photobooth Funbooth<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#Hats_for_Cats_Draggable_Costumes\" >Hats for Cats! Draggable Costumes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#A_Blinking_Oval\" >A Blinking Oval&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#Say_Cheese_A_Button_That_Saves_The_Photo\" >Say Cheese: A Button That Saves The Photo<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#Custom_Cutouts\" >Custom Cutouts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#Make_Code_Interactive\" >Make Code Interactive!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#More_Activities\" >More Activities?&nbsp;<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Is_This_Thing_On\"><\/span>Is This Thing On?&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before we get too excited, let\u2019s make sure that you have a working webcam. Add this script to the Stage and then press <strong>Play<\/strong>.  <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111918\/video.png\" alt=\"The shortest AR program you can write: On start, turn video on\" class=\"wp-image-21252\" width=\"183\" height=\"138\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111918\/video.png 733w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111918\/video-150x113.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111918\/video-300x226.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111918\/video-94x70.png 94w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522111918\/video-600x450.png 600w\" sizes=\"auto, (max-width: 183px) 100vw, 183px\" \/><\/figure>\n<\/div>\n\n\n<p>You should see yourself (or whatever your webcam is pointing at) on the Tynker Stage. Click <strong>Stop <\/strong>and keep coding.&nbsp;<br><\/p>\n\n\n\n<p><strong><em>Hint: <\/em><\/strong>If your web browser asks permission to record from the webcam, <strong>Allow <\/strong>it so that Tynker can take photos and record videos.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Photobooth_Funbooth\"><\/span>Photobooth Funbooth<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It\u2019s a costume party! Your costumes are entirely digital, so you can become whatever you like.&nbsp;<br><\/p>\n\n\n\n<p>I drew a cowboy mustache, a classy top hat, and set of cat ears, all in a single actor. Try drawing your own Costumes actor (<strong>Add Actor &gt; Drawing Tool<\/strong>).&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"446\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522114222\/costumes-resize.gif\" alt=\"AR costumes: A top hat, cat ears, and cowboy mustache drawing is shown in Tynker's Drawing Tool \" class=\"wp-image-21267\"\/><\/figure>\n<\/div>\n\n\n<p>Then you can control your actor with events. Here\u2019s code to make the actor switch each time you press <strong>space<\/strong>:&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112029\/next-costume-1024x517.png\" alt=\"When Space is pressed, next costume program \" class=\"wp-image-21254\" width=\"256\" height=\"129\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112029\/next-costume-1024x517.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112029\/next-costume-150x76.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112029\/next-costume-300x152.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112029\/next-costume-768x388.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112029\/next-costume.png 1093w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>On Your Own:<\/strong> Make your project even cooler by coding on-screen buttons that make the costumes swap. Try updating the code so the costume-switching is controlled with custom <strong>broadcast <\/strong>blocks.&nbsp;<br><br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112050\/switch1.png\" alt=\"Broadcast &quot;switch&quot; block \" class=\"wp-image-21255\" width=\"218\" height=\"69\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112050\/switch1.png 870w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112050\/switch1-150x48.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112050\/switch1-300x95.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112050\/switch1-768x244.png 768w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112059\/when-I-receive-1024x289.png\" alt=\"When I receive &quot;switch&quot; block \" class=\"wp-image-21256\" width=\"256\" height=\"72\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112059\/when-I-receive-1024x289.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112059\/when-I-receive-150x42.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112059\/when-I-receive-300x85.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112059\/when-I-receive-768x217.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112059\/when-I-receive.png 1127w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Hats_for_Cats_Draggable_Costumes\"><\/span>Hats for Cats! Draggable Costumes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\n\nYou can add draggable props and costumes, too! Here\u2019s a hint on how to code one:&nbsp;\n\n<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-1024x704.png\" alt=\"An augmented reality costume that goes to the mouse\" class=\"wp-image-21257\" width=\"256\" height=\"176\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-1024x704.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-150x103.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-300x206.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-768x528.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-220x150.png 220w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable-1280x880.png 1280w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112125\/draggable.png 1405w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure>\n<\/div>\n\n\n<p>This is a great way to put an AR costume on your pet!&nbsp;<br><br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112200\/clem-hat.png\" alt=\"A real life photo of a cat with an AR hat costume placed on it\" class=\"wp-image-21258\" width=\"134\" height=\"169\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112200\/clem-hat.png 537w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112200\/clem-hat-119x150.png 119w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112200\/clem-hat-239x300.png 239w\" sizes=\"auto, (max-width: 134px) 100vw, 134px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"A_Blinking_Oval\"><\/span>A Blinking Oval&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Did you notice that in one of the demos, an oval flashed on screen, giving you an idea of where to put your head?<br><\/p>\n\n\n\n<p>Here\u2019s the code that created the blinking effect for the oval actor:&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval-1024x1003.png\" alt=\"Program for a blinking oval that uses show and hide blocks\" class=\"wp-image-21259\" width=\"256\" height=\"251\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval-1024x1003.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval-150x147.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval-300x294.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval-768x752.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval-1280x1253.png 1280w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112231\/blinking-oval.png 1581w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Say_Cheese_A_Button_That_Saves_The_Photo\"><\/span>Say Cheese: A Button That Saves The Photo<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can save a photo of yourself in your costume to share! Here\u2019s code for a button actor that takes a screenshot.&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112253\/say-cheese-548x1024.png\" alt=\"Program for a screenshot button \" class=\"wp-image-21260\" width=\"137\" height=\"256\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112253\/say-cheese-548x1024.png 548w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112253\/say-cheese-80x150.png 80w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112253\/say-cheese-160x300.png 160w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112253\/say-cheese-768x1436.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112253\/say-cheese.png 921w\" sizes=\"auto, (max-width: 137px) 100vw, 137px\" \/><\/figure>\n<\/div>\n\n\n<p>Notice how it hides itself as the screenshot is taken. The broadcast \u201c<strong>cheese<\/strong>\u201d might tell all the other on-stage buttons to hide, too!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Custom_Cutouts\"><\/span>Custom Cutouts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Want to draw more than a costume? Here\u2019s one idea.&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112314\/mona-lisa-687x1024.jpg\" alt=\"Mona Lisa painting with the face masked\" class=\"wp-image-21261\" width=\"172\" height=\"256\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112314\/mona-lisa-687x1024.jpg 687w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112314\/mona-lisa-101x150.jpg 101w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112314\/mona-lisa-201x300.jpg 201w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112314\/mona-lisa-768x1145.jpg 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112314\/mona-lisa.jpg 1073w\" sizes=\"auto, (max-width: 172px) 100vw, 172px\" \/><\/figure>\n<\/div>\n\n\n<p>You can create a \u201ccutout\u201d using this code:&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on-1024x668.png\" alt=\"Short mask using oval program\" class=\"wp-image-21262\" width=\"256\" height=\"167\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on-1024x668.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on-150x98.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on-300x196.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on-768x501.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on-1280x835.png 1280w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112516\/mask-on.png 1472w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure>\n<\/div>\n\n\n<p>Add this script to your stage. Experiment with the <strong>width <\/strong>and <strong>height <\/strong>until you like the effect! Change the mask\u2019s shape from <strong>oval <\/strong>to <strong>rectangle <\/strong>and watch what happens.&nbsp;<br><\/p>\n\n\n\n<p>You can add new backgrounds by going to the Actor\u2019s list, <strong>Stage &gt; \u2699\ufe0f&gt; Add Background.&nbsp;<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Make_Code_Interactive\"><\/span>Make Code Interactive!<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Are you starting to see the cool coding possibilities of Augmented Reality?&nbsp;<br><\/p>\n\n\n\n<p>Want some ideas for your own AR projects? Take Tynker\u2019s <a href=\"https:\/\/www.tynker.com\/courses\/home-augmented-reality\"><strong>AR Course<\/strong><\/a>.&nbsp;<br><\/p>\n\n\n\n<p>By completing over 50 fun coding activities, you\u2019ll learn to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use motion detection and gestures in your coding projects<\/li>\n\n\n\n<li>Add special effects like transparency and mirroring to your camera feed<\/li>\n\n\n\n<li>Design fun AR versions of classic games like Fruit Ninja, Pong, and Brick Breaker<\/li>\n\n\n\n<li>Create your own virtual boxing game!<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"262\" height=\"147\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200522112604\/monkey-fight.gif\" alt=\"An AR boxing match demonstration. A human player faces of a computer opponent monkey \" class=\"wp-image-21263\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"More_Activities\"><\/span>More Activities?&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Looking for more coding activities? Check out the&nbsp;<strong><a href=\"https:\/\/www.tynker.com\/parents\/\">Course Catalog<\/a><\/strong>.&nbsp;<br><\/p>\n\n\n\n<p>And read more <strong>Tynker Toolbox<\/strong> articles, too!<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-workshop-basics\/\"><strong>Tynker Workshop Basics<\/strong><\/a> \u2014 Learn about coordinates and start coding with Tynker.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/animation-tool\/\"><strong>The Animation Tool<\/strong><\/a> \u2014 Learn about frame-based animation and other animation tips.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-character-creator\/\"><strong>The Character Creator<\/strong><\/a> \u2014 Take control of custom rigs using the Animation blocks.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/text-tricks\/\"><strong>Text Tricks<\/strong><\/a> \u2014 Work with speech bubbles and more. Tell your own stories, put on a play, or make a computer write poetry!<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-sound-blocks\/\"><strong>The Sound Blocks<\/strong><\/a> \u2014 Play music with code! Add custom sound effects, too. Tynker\u2019s brand new music tool supports MIDI and MP3.&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/the-synth-blocks\/\"><strong>The Synth Blocks<\/strong><\/a> \u2014 Create your own sound effects and instruments! You can create crunchy dubstep drops, glitchy chiptunes, or instruments from any style of music you can imagine!&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/\"><strong>Code Block Tricks<\/strong><\/a> \u2014 Get top-secret ninja tips for writing code fast in Tynker Workshop.&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-pen-blocks\/\"><strong>The Pen Blocks<\/strong><\/a> \u2014 Make your actors draw as they move. Create patterns, draw geometric shapes, and more.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-physics-blocks\/\"><strong>The Physics Blocks<\/strong><\/a> \u2014 Create games or simulations with gravity, collisions, and more. Think: <em>Angry Birds<\/em> and <em>Marble Madness<\/em>.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-ai-blocks\/\"><strong>The Artificial Intelligence (AI) Blocks<\/strong><\/a> \u2014 Take your AR projects to the next level with face-, hand-, and pose-tracking. Explore what makes AI special.&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/debugger\/\"><strong>The Debugger<\/strong><\/a><span style=\"color: initial;\"> \u2014 Learn about Tynker\u2019s data debugger and get bug-fixing tips.<\/span><\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-tutorial-builder\/\"><strong>The Tutorial Builder<\/strong><\/a> \u2014 Did you ever make a really cool Tynker Block project and wish you could teach the whole world exactly how you did it? Now you can!<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-python-editor\/\"><strong>The Python Editor<\/strong><\/a> \u2014 Looking for a challenge? Ready for your next step on your coding journey? Learn Python with Tynker too, and take the plunge into text-based coding.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AR brings coding to life! AR, short for Augmented Reality, is a way of adding computer-generated effects to real-life photos and videos. And, as an added bonus, AR projects will get you moving around, too! Here\u2019s a look at what\u2019s possible with AR. Check out Wipe Away, a timed game where you have to touch on-screen blocks with your hands [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":21278,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[510,12,123],"tags":[434,435,429],"class_list":["post-21247","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-block-coding","category-ideas-and-tips","category-new-tynker-features","tag-ar","tag-live-video","tag-tynker-toolbox"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tynker Toolbox: The AR Blocks - Tynker Blog<\/title>\n<meta name=\"description\" content=\"Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie! Explore simple augmented reality code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tynker Toolbox: The AR Blocks - Tynker Blog\" \/>\n<meta property=\"og:description\" content=\"Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie! Explore simple augmented reality code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/\" \/>\n<meta property=\"og:site_name\" content=\"Tynker Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Gotynker\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-26T18:58:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-15T19:01:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200526115528\/blog-23.png\" \/>\n\t<meta property=\"og:image:width\" content=\"996\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tynker Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gotynker\" \/>\n<meta name=\"twitter:site\" content=\"@gotynker\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tynker Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tynker Toolbox: The AR Blocks - Tynker Blog","description":"Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie! Explore simple augmented reality code.","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:\/\/www.tynker.com\/blog\/the-ar-blocks\/","og_locale":"en_US","og_type":"article","og_title":"Tynker Toolbox: The AR Blocks - Tynker Blog","og_description":"Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie! Explore simple augmented reality code.","og_url":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/","og_site_name":"Tynker Blog","article_publisher":"https:\/\/www.facebook.com\/Gotynker\/","article_published_time":"2020-05-26T18:58:12+00:00","article_modified_time":"2023-06-15T19:01:20+00:00","og_image":[{"width":996,"height":450,"url":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200526115528\/blog-23.png","type":"image\/png"}],"author":"Tynker Team","twitter_card":"summary_large_image","twitter_creator":"@gotynker","twitter_site":"@gotynker","twitter_misc":{"Written by":"Tynker Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#article","isPartOf":{"@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/"},"author":{"name":"Tynker Team","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/person\/934d769f4839cb9df678306ee728f671"},"headline":"Tynker Toolbox: The AR Blocks","datePublished":"2020-05-26T18:58:12+00:00","dateModified":"2023-06-15T19:01:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/"},"wordCount":982,"publisher":{"@id":"https:\/\/www.tynker.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#primaryimage"},"thumbnailUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200526115528\/blog-23.png","keywords":["AR","Live Video","Tynker Toolbox"],"articleSection":["Block Coding","Ideas and Tips","New Tynker Features"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/","url":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/","name":"Tynker Toolbox: The AR Blocks - Tynker Blog","isPartOf":{"@id":"https:\/\/www.tynker.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#primaryimage"},"image":{"@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#primaryimage"},"thumbnailUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200526115528\/blog-23.png","datePublished":"2020-05-26T18:58:12+00:00","dateModified":"2023-06-15T19:01:20+00:00","description":"Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie! Explore simple augmented reality code.","breadcrumb":{"@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tynker.com\/blog\/the-ar-blocks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#primaryimage","url":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200526115528\/blog-23.png","contentUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200526115528\/blog-23.png","width":996,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Coding for Kids","item":"https:\/\/www.tynker.com\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/www.tynker.com\/blog\/"},{"@type":"ListItem","position":3,"name":"Tynker Toolbox: The AR Blocks"}]},{"@type":"WebSite","@id":"https:\/\/www.tynker.com\/blog\/#website","url":"https:\/\/www.tynker.com\/blog\/","name":"Tynker Blog","description":"Tynker makes it fun and easy to learn computer programming. Get started today with Tynker&#039;s easy-to-learn, visual programming courses designed for young learners in grades K-12.","publisher":{"@id":"https:\/\/www.tynker.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tynker.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.tynker.com\/blog\/#organization","name":"Tynker - Coding for Kids","url":"https:\/\/www.tynker.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20220713063303\/appicon-120.png","contentUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20220713063303\/appicon-120.png","width":120,"height":120,"caption":"Tynker - Coding for Kids"},"image":{"@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Gotynker\/","https:\/\/x.com\/gotynker","https:\/\/www.instagram.com\/tynkercoding\/","https:\/\/www.pinterest.com\/gotynker\/","https:\/\/www.linkedin.com\/company\/tynker"]},{"@type":"Person","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/person\/934d769f4839cb9df678306ee728f671","name":"Tynker Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/53c002ba171d44324489e00b00f5b0ebf381cabfef3347db5e6d5257409d92ba?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/53c002ba171d44324489e00b00f5b0ebf381cabfef3347db5e6d5257409d92ba?s=96&d=mm&r=g","caption":"Tynker Team"},"url":"https:\/\/www.tynker.com\/blog\/author\/lpateltynker-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts\/21247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/comments?post=21247"}],"version-history":[{"count":16,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts\/21247\/revisions"}],"predecessor-version":[{"id":34753,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts\/21247\/revisions\/34753"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/media\/21278"}],"wp:attachment":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/media?parent=21247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/categories?post=21247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/tags?post=21247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}