 Today, we are going to make a cool space battle game in Pictoblocks that we are going to play using a smartphone. The aim of the game is to destroy the army of space monsters by firing bullets at them. Let's begin. First of all, connect a Vive to your computer via a USB cable. Then open Pictoblocks. Next, click on the board button in the toolbar and select a Vive from the drop-down menu. Click on the connect button and select the appropriate port. Now, let's make the game. First, let's set the stage. Since the battle is going to take place in space, we need a backdrop that looks like outer space. Click on the choose a backdrop button and select the stars backdrop from the library. Time to bring in the characters, aka the sprites. But before we add them, we must say goodbye to Toby. Right click on his icon and select delete from the drop-down menu. Now, click on the choose a sprite button to open the library. For our game, we need three sprites, a rocket ship, the enemy that is the space monsters, and a special monster killing bullets. Add them one by one from the library. Let's first write the script for our rocket ship. Select it from the sprite palette. Now drag and drop the when flag clicked block in the scripting area. Then drag and drop the go to XY block below the when flag clicked block. Set X as 0 and Y as minus 140. These coordinates will be our rocket ship's initial position. Change it to 40% of the original size. Now let's add some sound to the game. Add the start sound block from the sound palette. Then click on the sound tab. In the bottom left corner, you will find the choose a sound button. Click on it. Then select the video game one sound from the library. Come back to the scripting area by clicking on the code tab. And from the drop-down of the start sound block, choose video game one. Now, we need to create two variables. One to monitor the health of our rocket ship. And the other to keep track of how many enemies we have killed. Go to the variables palette and create the variables health and score. Set the initial value of health to 3 and score to 0. Using the set variable to block from the variables palette. Then drag and drop the forever block from the control palette. Next, drag and drop the if block. We are going to use theables gamepad module to control our rocket ship. We need to use blocks from the double palette to write the instructions for the same. Drag and drop the is pressed on gamepad block and select left from the drop-down menu. Drag and drop the change x by block inside the if block and change the value to minus 15. On pressing left, the value of x coordinate will change by minus 15. That is, our rocket ship will move 15 steps in the left. Duplicate the if block and place the duplicated block below the first one. Now, select right from the drop-down of the is pressed on gamepad block in the second if block and change the value of x in the second change x by block to 15. This means that on pressing right on the gamepad, the value of x coordinate will change by 15 and the rocket will go right. Now, it's time for the special monster killing bullets. We will fire them using the triangle button on the gamepad. Duplicate the if block again. This time, select triangle from the drop-down of the is pressed on gamepad block. For generating multiple bullets, we are going to use the create clone of block. Drag and drop it inside the third if block and select bullet from its drop-down. Finally, add a weight block and set the time to 0.1 seconds. No battle game is complete without an enemy. So, let's bring in the monsters. We are going to write two scripts for the monsters. One for creating the monster clones and the other for assigning actions to them. First, let's write the script for creating the monster clones. Select the monster sprite from the sprite's library. Then, drag and drop the when flag clicked block. Next, drag and drop the forever block. Inside the forever block, drag and drop the next costume block. Then, add the create clone of block to create clones of the monster sprite. Select the weight block and set the time as 2 seconds. This will make sure that each clone appears 2 seconds after the previous one. Now that the monsters are here, it's time to assign actions to them. From the control palette, drag and drop the when I start as a clone block. This block will make the script run every time a clone of the monster sprite is created. Now, drag and drop the show block from the looks palette. Next, drag and drop go to XY block. Drag and drop the pick random block from the operators palette into the space next to X and set the range as minus 200 to 200. Set Y as 180. Now, drag and drop the repeat until block. Place the greater than operator block and write minus 170 in the first space. Drag and drop the Y position reporter block from the motion palette into the second space. Then, drag and drop the change Y by block from the motion palette and write minus 3 in the space. This will make the monster gradually move downward until either it reaches the bottom of the stage or you shoot them down. Now, drag and drop the if block. Then, drag and drop the touching block from the sensing palette into the hexagonal space and select bullet from the drop down. As soon as a monster is hit by a bullet, the score should increase. For that, drag and drop the change my variable by block and select the score variable from the drop down. Now, let's add a sound for when a bullet hits a monster to make it more lively. Drag and drop the start sound block. Add the zoop sound from the sound library and select it from the drop down. The monster should disappear once hit by a bullet. Drag and drop the delete this clone block for the same. Now, let's write the part which decides what would happen if a monster attacks a rocket ship. Duplicate this if block and place the second block below the first one. From the drop down of the touching block in the second if block, select the rocket ship. Then select hit from the drop down of the change my variable by block. Write minus 1 in the space. Remove the start sound block. This part of the script makes sure that if a monster touches a rocket ship, its health will decrease by one. After that, the monster will disappear. Now the game should end as soon as the health goes down to zero. For that, again duplicate the if block. Replace the touching block with the equal to block from the operator's palette. Next, drag and drop the health variable block into the first space and write zero in the second. Remove the change my variable by and delete this clone blocks. Drag and drop the wait block and set the time as 0.5 seconds. Drag and drop the stop block and select all from the menu. At the end of the repeat until block, place the delete this clone block. Finally, click on the hide block into the looks palette. Now let's write the script for our monster killing bullets. First of all, select the bullets sprite. Then drag and drop the when I start as a clone block. Drag and drop the start sound block and add the laser to sound from the library. Set the initial position of the bullet same as that of the rocket ship so that it appears that the ship is firing the bullets. Next, drag and drop the go to XY block. Drag the off reporter block into space beside X from the sensing palette. Select X position from the first drop down and rocket ship from the second drop down. Now, duplicate this block and drop it into the second space. Select the Y position from the first drop down. Now drag and drop the repeat until block. Then drag and drop the all block into the hexagonal space. Next, drag and drop the touching block into the first space of the all block and select edge from the menu. Duplicate this block and drop it into the second space. Select monster from the drop down. Now the bullet should move upward until it either hits any of the monsters or reaches the top of the stage. For this, drag and drop the change Y by block and right 12 in the space. Then drag and drop delete the cone block below the repeat until block. Next, click on the hide block into the looks palette. With this, the code is complete. Now all we need to do is pair evive with double. First, connect the HZ05 Bluetooth module to evive. Next, open double in your smart phone. Then click on the connect disconnect icon. A list of nearby devices will appear. Select your device's name. Next, open the gamepad module in double and start playing. If you like this video, don't forget to give it a thumbs up. Bye bye.