 Hello everyone! Welcome back to our channel. I hope you all are safe and sound. Have you ever wondered how Tesla, the self-driving car, decides the route? Today we are going to make something similar but in Pictoblocks. We are going to make our own self-driving car in Pictoblocks, which will recognize the sign cards and act accordingly. We are going to use the recognition card extension of Pictoblocks. This extension is our very own take on a pre-trained classifier. We can recognize numbers, human like Hazel and John, traffic signals, card suits, other random cards like pizza, hospital, etc. There are a lot of new features added to the latest version of Pictoblocks, like the all-new Pictoblocks link feature, the new sign up in the credit system, also the latest extensions like NLP, recognition cards and IFTRIPITY. You can download the latest version from the link given in the description box below. Let's begin. First, we will set up our stage. We will make our stage look like this street. We already have designed one. You can download it from the link given below in the description box or you can design one for yourself. Open Pictoblocks. Upload the backdrop. Let me first walk you through the elements of the backdrop. There will be two lanes on which we will select by showing the number cards. Next are the three points which is home, pizza store and hospital. Once the lane is selected, the car will recognize the next card which is the location card and move on to reach that particular location. Now that we have the brief idea about the project, let's add our car sprite and the John sprite. But before we add the sprite, we need to say buy to Toby. Upload the car sprite from the computer which you can download from the link. You can even select the car sprite from the library. Next, choose John sprite from the sprite library. In our project, John is the instructor and the car will be following our commands. If you may have noticed that the lanes are in opposite directions. We need one car to face the other side. Thus, duplicate the car sprite, go to the costume palette, select the car and click on flip horizontally. With this, our stage and sprite setup is complete. Let's move on to write the script. Let's move on to write the script. Choose John sprite. We will begin by writing the script for our narrator. Place when flag clicked hard block from the events palette. Next, let's add the recognition card extension. Click on the add extension button and select the recognition card extension from the library. Place, turn on video on stage with 0% transparency block from the recognition card palette and select off from the drop down. Next, we need to have a clear backdrop. Thus, from the looks palette drag and drop switch backdrop to block and select a backdrop one from the library. Set John on the stage using the go to XY block from the motions palette. Write 21 in the first space given and minus 112 in the second space. Now, we need John to instruct the user to show the number card to select the lane. Thus, place a save block from the looks palette to make John speak. Write hello, let's go on a ride with the self-driving car. Duplicate the save block and write, in which lane do you want to write the car. Duplicate it again and replace the text width. Please see number card in front of the camera. Next, after instructing this much, we need to hide John so that the car can perform their actions. Thus, from the looks palette place a hide block. Now, to recognize the number card, we need to turn the camera on. Thus, place turn on video on stage with 0% transparency block from the recognition card palette and select on flipped from the drop down. We need to make John wait for a few seconds till pick two blocks and analyze the card. Thus, from the controls palette add a wait block and write 3 in the space given. Place analyze image from camera block from the recognition card palette. To make sure that the cards are recognized perfectly, we will add a bounding box around them. Thus, place the show bounding box block from the recognition card palette. Once analyzed, we need to hide the bounding box. Thus, add a wait of 2 seconds and place the show bounding box block again but select hide from the drop down. Also, let's off the camera. Thus, place turn on video on stage with 0% transparency block and select off from the drop down. Now, we need the car to perform the actions once lanes are recognized. Thus, place an if block from the controls palette. Place is number one detected reporter block from the recognition card palette into the ifr. To make the right direction car do the next steps, we will send the right cast write the message. From the events palette place broadcast message block and in the new message write lane 1. Duplicate the previous steps choose 2 from the first drop down and write new message to lane 2. With this, the script for our jaune is complete. Let's move on to write the scripts for our cars. Let's move on to write the scripts for the car. First, select the right car. At first, the car should not be visible. Thus, place when flat-clit heart block from the events palette. Next, from the looks palette place a height block. Now, let's write the script on what happens when you send the lane 1 message. Thus, from the events palette place the when I receive message block and select lane 1 from the drop down. Next, we need to switch the backdrop back. Thus, drag and drop the switch backdrop to block and select backdrop 2 which is the street from the drop down. We need the car to come to the initial position and point in the right direction. Thus, place point in direction block from the motions palette and write 90 in the space given. Drop go to xy block and write 242 in first and 62 in second space respectively. Now, the stage and the position of the car is set. It's time to show the car. Place show block from the looks palette. Now, to move the car further a bit place glide to xy block from the motion palette and write 147 and 62 in first, second and third places respectively. Now that the car has reached the intersection, we need the car to ask the user for the location where we want to go. Thus, place a say block and write you need to choose whether you want to go to the pieces store, home or hospital. Place another say block and write. Thus, place the location card in front of the camera. As we want to on the camera for a while, we will hide the car. Thus, place the hide block. Now, to recognize the location card similar to the number card, we will need to turn the camera on. Thus, place turn on video on stage with zero percent transparency block from the recognition card palette and select on flipped from the drop down. Add a weight block and write three in the space given. Place analyze image from camera block from the recognition card palette. Place the show bounding box block. Add a weight of two seconds and place the show bounding box block again, but select hide from the drop down. Also, let's turn off the camera. Thus, place turn on video on stage with zero percent transparency block and select off from the drop down. Now that the location card is analyzed, let's bring the card back on to make it move. Place the show block. Now if pizza is analyzed, we need the car to head towards the pizza store. Place an F block and drop the is pizza detected reporting block from the recognition card. Next into the F arm, we will write a couple of commands to move the car. To make it move a little forward, place glide to XY block and write 0.49 and 16 respectively. Now to make it turn upwards, place a point and direction block and write 180 in it. Now to make it move in the upward direction and then turn to the right, we will duplicate the glide and the point and direction block and write 0.66119 in the glide block and minus 90 in the point and direction block. With this, the car is now pointing in the right direction. Place another glide block and write 0.5109 and 127 respectively. With this, your car has reached to the pizza store from lane one. Make sure to change the numbers in the glide and the point and direction blocks if you have planned out the backdrop of your choice. Similar to the pizza store, we will write the code to make the car move to home and hospital from lane one. Duplicate the F arm again and make the changes according to the path to the hospital from lane one. Your script for the car if moving in lane one is complete. Now let's write the script for the car if it is in lane two. We will copy both the scripts from the right car into the left car. For it, just drag the scripts from one sprite to another. Now that both the scripts are copied, we will make the changes according to the left car. Select the left car. In when I receive the lane one block, select lane two from the drop down. Write minus 251 and minus 51 and go to XY block. Write 1 minus 22 and minus 52 in first, second and third space of the glide block respectively. The final changes are to be done to follow the path from lane two to pizza store, home and hospital respectively. If the script is complete, let's click on the green flag to see our self-driving car in action.