Back to Course
Class 6 - Coding, AI & Robotics Course
0% Complete
0/0 Steps
-
Coding
Session 1: Introduction to Coding3 Topics -
Session 2: Backdrop, Costume, and Animation3 Topics|1 Quiz
-
Session 3: Basics of Algorithm and Flowchart3 Topics|1 Quiz
-
Session 4: Basics of Pseudocode3 Topics|1 Quiz
-
Session 5: Getting Started with Quarky3 Topics|1 Quiz
-
Session 6: Variables: The Multitaskers4 Topics|1 Quiz
-
Session 7: Arithmetic Operators4 Topics|1 Quiz
-
Session 8: Conditional Statements3 Topics|1 Quiz
-
Session 9: Logical Operators4 Topics|1 Quiz
-
Session 10: Nested Conditional Statements2 Topics|1 Quiz
-
Session 11: Loops3 Topics|1 Quiz
-
Session 12: Touch Based Piano2 Topics
-
Session 13: Criterial in Loops5 Topics|1 Quiz
-
Session 14: Catch the Fruit Game - Part 12 Topics
-
Session 15: Catch the Fruit Game - Part 22 Topics|1 Quiz
-
Artificial IntelligenceSection 16: Introduction to Artificial Intelligence3 Topics|1 Quiz
-
Session 17: Basics of Face Detection2 Topics|1 Quiz
-
Session 18: Face Expression Detection2 Topics|1 Quiz
-
Session 19: Mimic Face with Quarky1 Topic
-
Session 20: Face Filter - Part 12 Topics
-
Session 21: Face Filter - Part 22 Topics
-
RoboticsSession 22: Basics of Robotics2 Topics|1 Quiz
-
Session 23: Wirelessly Controlled Robot2 Topics
-
Session 24: Introduction to Sensors3 Topics|1 Quiz
-
Session 25: Introduction to Actuators3 Topics|1 Quiz
-
Session 26: Face Tracking with Robot2 Topics
-
Session 27: Obstacle Avoidance Robot - Part 13 Topics
-
Session 28: Obstacle Avoidance Robot - Part 22 Topics|1 Quiz
-
Session 29: Edge Detector Robot - Part 13 Topics
-
Session 30: Edge Detector Robot - Part 22 Topics|1 Quiz
-
Capstone ProjectCapstone Project
Lesson 1,
Topic 3
In Progress
Activity: Make Tobi Walk
Lesson Progress
0% Complete
Let’s Code
Follow the steps below:
- Create a New file in PictoBlox:
- Follow the step if you are working on Windows, macOS, or Linux:
- Open PictoBlox and create a new file.
- Select the coding environment as Block Coding.
- Open PictoBlox and create a new file.
- Follow the step if you are working on Android or iPhone:
- Open PictoBlox App and select My Space Tab from the home screen.
- Click on + sign to create a new file.
The new file should be created like this.
- Open PictoBlox App and select My Space Tab from the home screen.
- Follow the step if you are working on Windows, macOS, or Linux:
- Open the Events palette and drag and drop the when flag clicked block into the scripting area. The when flag clicked block is a special type of block called hat block. It is used to start a script. Using this particular hat block you can run the script by clicking on the green flag above the stage.
- Next, open the Control palette and drag and drop the forever block below the when flag clicked block.
This block is used when you want a set of blocks to keep running until the script is stopped manually.
- Then, open the Motion palette and drag and drop the move () steps inside the forever block.
This block is used to move the sprite by a specified number of steps. In our case, it is 10. - Next, open the Control palette and drag and drop the wait () seconds block below the move () steps block and change the delay value to 0.1 seconds. The wait block is used to pause/delay the script execution by the specified time.
- Run the script by clicking the green flag. What just happened? Where did Tobi go?! As it seems, he went out of the frame. Let’s fix this so that the Tobi doesn’t wander off again.
- Open the Motion palette and drag and drop the when on edge, bounce block inside the forever block.
This block detects whether the sprite has touched the edge of the stage or not and change the direction if it has. - Run the script by clicking the green flag. What is happening to Tobi Now? Is he upside-down? To stop this, you must change the rotation style.
- Go to the Motion palette and drag and drop the set rotation style () below the when flag clicked block and select left-right from the drop-down.
- The script is now complete! Run it by clicking the green flag. Yay! You’ve just completed your first script! Pat yourself on the back.
Saving the Program
- To save the program, click on File > Save As.
- A window will popup. Choose the location as Desktop or any other relevant folder. Name the file Tobi Walking.
- Click on Save.
The file is saved with a .sb3 extension on your computer.
Assignment
Before you move on to the next lesson, a small assignment awaits you!
You must upload the PictoBlox program you created in this activity to the website. Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
- Click on Browse.
- Search and Select your saved Project file(.sb3) and Click Open.
- Click on Upload to submit the assignment.
The file type allowed is the SB3 file generated from the PictoBlox program. The maximum file size allowed is 5 MB.
Good luck!