Слайд 2Beetle in the Maze
In this activity you will make an animated game
![Beetle in the Maze In this activity you will make an animated](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-1.jpg)
in PictoBlox where beetle needs help to come out of the maze without touching the boundaries.
Слайд 4Setting up the Stage
Right below the stage, you will see a purple button
![Setting up the Stage Right below the stage, you will see a](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-3.jpg)
with a bear on it. Take the cursor over it and select Choose a Sprite; the sprite library will open.
Select the beetle sprite from the library.
Слайд 5Setting up the Stage
Now, there are two sprites: beetle and Tobi.
Right
![Setting up the Stage Now, there are two sprites: beetle and Tobi.](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-4.jpg)
click on the icon for Tobi (below the stage) and click on the delete option.
Слайд 6Setting up the Stage
Click on the purple colored icon which says Choose a
![Setting up the Stage Click on the purple colored icon which says](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-5.jpg)
Backdrop.
Select the maze backdrop from the library.
Слайд 8Interfacing evive with PictoBlox
Connect evive to your laptop/PC and open PictoBlox.
In PictoBlox,
![Interfacing evive with PictoBlox Connect evive to your laptop/PC and open PictoBlox.](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-7.jpg)
go to the menu and click on the Boards Select the evive.
Слайд 9Interfacing evive with PictoBlox
Once you’ve selected the board, click on the Connect
![Interfacing evive with PictoBlox Once you’ve selected the board, click on the](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-8.jpg)
tab and connect the board.
Слайд 10Upload Firmware
You have to upload the firmware into the device before interacting
![Upload Firmware You have to upload the firmware into the device before](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-9.jpg)
with it.
Click on Upload Firmware button.
Once you successfully uploaded the firmware you will see evive logo on evive display.
Слайд 11Giving the Beetle Its Moves
We will control the Beetle movement using Navigation
![Giving the Beetle Its Moves We will control the Beetle movement using](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-10.jpg)
Key of evive.
The beetle must move in the direction we push the key.
navigation key is in state () ? block checks if the navigation key is in one of the four particular directions. The direction for which you wish to check is your choice and can be chosen from the drop down on the block.
Слайд 12Giving the Beetle Its Moves
Write the code to move the beetle in
![Giving the Beetle Its Moves Write the code to move the beetle](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-11.jpg)
up direction & test:
Try to make the code for other directions.
Слайд 13Giving the Beetle Its Moves
For ‘down’, set the direction as 180.
For ‘right’,
![Giving the Beetle Its Moves For ‘down’, set the direction as 180.](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-12.jpg)
set the direction as 90.
For ‘left’, set the direction as -90.
Слайд 15Sensing the environment
Now, it’s time to write the script for safely taking
![Sensing the environment Now, it’s time to write the script for safely](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-14.jpg)
the beetle to the end of the maze.
Make the code to initialize the game, so that every time game starts at one position.
Слайд 16Sensing the environment
Now we will add the condition when the beetle touch
![Sensing the environment Now we will add the condition when the beetle](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-15.jpg)
maze, it will go back to its original position.
Using the color picker, pick the
maze color.
Слайд 17Sensing the environment
Now we will add the condition to end the game.
![Sensing the environment Now we will add the condition to end the](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/976925/slide-16.jpg)
Game ends when the beetle touches the apple.
Using the color picker, pick the
apple color.
Game is complete now. Play!