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 15,
Topic 1
In Progress
Making Monkey Move
Lesson Progress
0% Complete
Making the Monkey Move
Now it’s time to write the scripts for the Monkey sprite. Let’s begin!
![evive Notes Icon](https://learn.edustream.ae/wp-content/uploads/2023/09/teacher_finger_notes_80px.png)
Make sure that the Monkey sprite is selected.
Controlling the Movements Using Quarky
Follow the steps:
- Go to the Sensors palette and add a is button () pressed ? block into the scripting area. The button, L, is set as the default option.
- To check if L is pressed, we’ll use an if block. Go to the Control palette and drop an if block into the scripting area. Drop the is button () pressed ? block in the white space of the if block.
- If L is pressed, then, according to our logic, Tobi should move left. Therefore, go to the Motion palette and drop a move () steps block inside the if block and write -10 in the space. The “-” sign means that direction of movement is left.
- However, if R is pressed, then Tobi should move right. Therefore, add another if block below the first one and drop a is button () pressed ? block in the white space.
- Then, go to the Motion palette and drop a move () steps block inside the if block, and write 10 in the space.
- Add a forever block around the entire script.
- To add the finishing touch, add a when flag clicked block from the Events palette above the forever block.
- set size to () % block from the Looks palette. We’re using this block to reduce the size of the sprite to “80%” of the original size.
- go to x: () y: () block. We’re using it to fix the position of the sprite at the beginning of the game.
Below is the complete script: