0% found this document useful (0 votes)
56 views32 pages

Tle7 - 8-Ict-Programming For Robotics W8

Uploaded by

Karen Martonia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views32 pages

Tle7 - 8-Ict-Programming For Robotics W8

Uploaded by

Karen Martonia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

8

Technology and
Livelihood
Education (TLE)
ICT- Programming for
Robotics
Week 8

i
Technology and Livelihood Education Grade 8
Self-Learning Module-Programming for Robotics
Week 8
First Edition, 2020

Republic Act 8293 section 176 states that: No copyright shall subsist in any work
of the Government of the Republic of the Philippines. However, prior approval of the
government agency or office wherein the work is created shall be necessary for
exploitation of such work for profit. Such agency of office may, among other things.
Impose as a condition the payment of royalties.

Borrowed materials (i.e., songs, stories, poems, photos, brand names, trademarks,
etc.) included in this book are owned by their respective copyright holders. Every
effort has been exerted to locate and seek permission to use these materials from
their respective copyright owners. The publisher and authors do not represent nor
claim ownership over them.

DEVELOPMENT TEAM OF THE MODULE

Writers : Chito B. Macabudbud


Editor : Ma. Mariza A. Maglangit, PSDS, District 6
Reviewers : Reynold Q. Velos, EPSVR
Illustrator :
Layout Artist :
Plagiarism Detector Software : PlagiarismDetector.com
Grammarly Software : CitationMachine.com

Management Team:
Schools Division Superintendent : Dr. Wilfreda D. Bongalos CESO V
Assistant Schools Div. Superintendent : Dr. Marcelita S. Dignos CESO VI
Chief Education Supervisor, CID : Dr. Oliver M. Tuburan
Education Program Supervisor, LRMDS : Mrs. Teresita A. Bandolon
Education Program Supervisor, TLE : Reynold Q. Velos

Department of Education – Regional Office 7


DepED-Division of Lapu-Lapu CIty
Office Address : B. M. Dimataga Street, Poblacion, Lapu-Lapu City
Telefax : (032) 340 7887
E-mail Address : [email protected]

ii
Property of DepED-Division of Lapu-Lapu City | www.depedlapulapu.net.ph | (032) 340-7354
INTRODUCTORY MESSAGE

For the facilitator:

Welcome to Technology and Livelihood Education (TLE Self-Learning Module


on Programming for Robotics.

This module was designed, developed, and reviewed by educators both from public
and private institutions to assist you, the teacher or facilitator in helping the
learners meet the standards set by the K to 12 Curriculum while overcoming their
personal, social, and economic constraints in schooling.

This learning resource hopes to engage the learners in guided and independent
learning activities at their own pace and time. Furthermore, this also aims to help
learners acquire the needed 21st-century skills while taking into consideration
their needs and circumstances.

As a facilitator, you are expected to orient the learners on how to use this module.
You also need to keep track of the learners’ progress while allowing them to manage
their learning. Furthermore, you are expected to encourage and assist the learners
as they do the tasks included in the module.

For the learner:

Welcome to the Technology and Livelihood Education (TLE Self-Learning


Module on Programming for Robotics.

This module was designed to provide you with fun and meaningful opportunities for
guided and independent learning at your own pace and time. You will be enabled to
process the contents of the learning resource while being an active learner.

iii
HOW TO USE THE MODULE

Welcome!

This module is about sprites and their behavior. The module will teach the learners
the basics of programming language in creating interactive games and useful apps
in fun and creative ways.

The activities are designed and chosen specifically to help the learners code with or
without a computer. Each topic is complete with examples, illustrations, and
explanations.

Make the best use of this module. Complete the previous lesson before thoroughly
engaging in this module. That way, it will be easier for you to understand the lessons.

Carefully read the information sheets in each section and check your acquired
knowledge by answering the self-check. At the end of each section, perform the task
to test your knowledge and skills. Assess your performance by using the provided
performance criteria checklist.

You can apply what you learned if you have access to the internet for just an hour.
Go to the code.org website and sign in using your Facebook account or other
accounts. If you have questions, feel free to ask your teacher/facilitator.

Happy coding!

iv
Lesson 1 – SPRITES AND IT’S BEHAVIOR

What I Need to Know


This will give you an idea of the skills or competencies you are expected to
learn in the module.

This lesson is designed with you in mind to help you learn the concept of
sprites and their behavior and how to use it to create interactive games and other
useful apps.

At the end of this module, you should be able to:


Content Standards:
A. demonstrate understanding of how to use sprite and its behaviors.
Performance Standards:
A. Create an interactive game using different sprite and their behaviors.
Learning Competency:

1. Define “sprite” as a character or object on the screen that can be moved and
changed.
2. Create a new sprite and choose its appearance.
3. Identify actions that correlate to input events.
4. Create an animated, interactive game using sequence and events.

DepED-Division of Lapu-Lapu City 1 TLE/TVE/TVL


What I Know
This part includes an activity that aims to check what you already know about
the lesson to take. If you get all the answers correctly (100%), you may decide
to skip this module.
Pre-Test
Test A. Multiple Choice

Directions: Read carefully and encircle the letter of the correct answer.

1. A sprite is:
A. A tiny dots on the screen C.an immovable image
B. An object on the screen to manipulate D. Object that consist of varied code
2. Which among these is a sprite behavior?
A. Twist C. move
B. Bend D. Break

3. What is the location of this sprite?


A. Bottom C. Right
B. Center D. Left
4. Which among these are events in the sprite lab?
A. When Sprite is clicked C. When Sprite is double-clicked
B. When Sprite touches the screen D. When Sprite is not clicked
5. What is the location of this sprite when created?

A. Center C. Middle left corner


B. Lower right corner D. Lower left corner
6. These blocks will make the sprite responds when someone plays with it.
A. Actions C. Behaviors
B. Events D. Sprites
7. Which among these is an Action block?

DepED-Division of Lapu-Lapu City 2 TLE/TVL


8. Study the mystery code and predict what will happen to the globe when the code
is run.

A. The sprite will spin. C. The sprite will shrink.


B. The sprite will move. D. The sprite will change color.

9. Study the sprite behavior. Which way will the satellite move towards the sky?

A. Down and right C. Down then left


B. Diagonally D. Zig zag
10. Which among these codes will make the Astronaut move from left to right of the
screen?

Test B. True or False

DepED-Division of Lapu-Lapu City 3 TLE/TVL


Directions: Carefully read the statement to determine if it is true or
otherwise. Write T if the statement is true and F if the statement is false.

______1. Sprite lab can only create a fun app.


______2. Sprites can interact with each other.
______3. The sprite color can be changed.
______4. The number of sprites created in the sprite lab is limited to 10 characters.
______5. A virtual pet can be created in the sprite lab.

Refer to Answer Key

DepED-Division of Lapu-Lapu City 4 TLE/TVL


What’s In
This is a brief drill or review to help you link the current lesson with the
previous one.

In this module, students will learn about the two concepts at the heart of
Sprite Lab: sprites and behaviors. Sprites are characters or objects on the screen
that students can move, change, and manipulate. Examples of these are our favorite
flappy Bird, Sloppy Bird, and many more. Behaviors are actions that sprites will
continuously do until they are stopped. Students will interact with characters using
user input and create their fish tanks or an alien dance party. Finally, they will learn
to create their customized behaviors.

What’s New
In this portion, the new lesson will be introduced to you in various ways; a
story, a song, a poem, a problem opener, an activity, or a situation.

Have you played and enjoyed this adorable game?

In this lesson, you will be introduced to the basics of sprites and their
behavior to create fun games and other useful apps.

DepED-Division of Lapu-Lapu City 5 TLE/TVL


What Is It
This section provides a brief discussion of the lesson. This aims to help you
discover and understand new concepts and skills.

Swimming Fish with Sprite Lab


Sprite lab is where we can create imaginative, fun, or any useful apps. The
characters and objects that are inside the lab are called sprites. There are a lot of
things we can do with sprite. We can change its costume, its location on the screen,
and how it behaves. And to make it even more interesting, the sprite can even interact
with a user and with each other.

Lets get started.

The sprite lab.

Image from code.org

Parts:

Playspace- this is where the characters will show up.


Toolbox- here you can select the code blocks needed for your program.

Image from code.org

DepED-Division of Lapu-Lapu City 6 TLE/TVL


Image from code.org

DepED-Division of Lapu-Lapu City 7 TLE/TVL


Workspace- the area where you will write your code using the code blocks.

Activity 1. What do you think will happen to the tumbleweed sprite when you run
the code?

Code blocks and image from code.org

Can you guess it?

Yes, it will tumble endlessly.

Activity 2. Let’s make a fish tank! (Try to draw your code before seeing the
solutions below)

Image from code.org

Instructions:
1. Change the tumbleweed into any fish.
2. Be sure to change the sprite’s costume.
3. Set the background to blue.
4. Make the fish swim left and right.

DepED-Division of Lapu-Lapu City 8 TLE/TVL


Solution:

1. Assemble the following code

Code blocks from code.org

2. Change the tumble into any fish by clicking

Code blocks from code.org

3. Update the sprite’s costume in Code blocks from code.org

4. To keep the fish from tumbling forever, change the fish behavior from

to

5. The final code.

Code blocks from code.org

DepED-Division of Lapu-Lapu City 9 TLE/TVL


Activity 3. The fish is getting lonely! Let’s add another fish with a different
costume to swim left and right (Try to draw your code before seeing the
solutions below)

Image from code.org

Solution:

Code blocks from code.org

DepED-Division of Lapu-Lapu City 10 TLE/TVL


Challenge
It’s time to be playful! (Draw your code before seeing the solutions below)
Instructions:
Using the code block from pages 6 to 7, change the behavior of the fish at the top of
the tank to make it wander around. When the fish at the bottom touches the
wandering fish, make it spin right. Use event blocks and behavior blocks to do this.

Draw your Solution.

Image from code.org

Solution:

Code blocks from code.org

DepED-Division of Lapu-Lapu City 11 TLE/TVL


Alien Dance Party with Sprite Lab
This lesson focuses on making the sprite react to inputs like a mouse click
or when they touch each other.
Not let's have fun with some aliens!

Activity 1.
Instruction:
Make a prediction: What do you think will happen to the alien when you
click on it?

Code blocks and images from code.org

Answer. When you click on the alien, it will go up and down on the screen.

Activity 2.
Instructions:

The alien is proud of its dancing skills on Mars, but now it can only move
from side to side. Replace the alien's behavior that will make it start spinning!

Code blocks and image from code.org

DepED-Division of Lapu-Lapu City 12 TLE/TVL


Solution:

Code blocks from code.org

Activity 3

Instructions:
Create a new sprite that looks like a pink alien while retaining the previous
alien. Make it patrol the Marsian surface when it’s clicked.
Use the following code blocks:

Code blocks from code.org

Solution:

Code blocks from code.org

We have used the so far in making our sprite respond to


inputs. But we can also use to making the sprite respond to
keyboard input.
We have so far made the aliens respond to user inputs, but we can also make
the aliens interact with each other by using the code block

DepED-Division of Lapu-Lapu City 13 TLE/TVL


Activity 4
Instructions:
For the pink alien, fun is contagious! Touching it makes anyone want to dance.
Make the blue alien begin a new dance move when the pink alien touches it.

Solutions:

Code blocks and image from code.org

There are a lot of things you can do with code to make fun and exciting games.
You can even make an alien dance party. Your creativity in using the code blocks is
the limit.

Behaviors with Sprite Lab


Activity 1
Instructions:
Study the code inside the mystery behavior and predict what will happen to
the globe.

DepED-Division of Lapu-Lapu City 14 TLE/TVL


Code blocks and images from code.org

What will happen to the globe when the code is run? Will it spin, will it
shrink, will it move, or will it change color?
Yes, the globe will shrink since when the code is run, the sprite (globe) will
change the size by -1. Meaning it will continue to reduce its size by 1.

Activity 2
Instructions
Fly the rocket to the stars!

Image from code.org

DepED-Division of Lapu-Lapu City 15 TLE/TVL


Code blocks from code.org

How will you edit the flying behavior to make the rocket fly to the stars?

Solutions:

code blocks from code.org

Click and replace South to North directions.

Activity 3
Instructions
Help the rover outrun the robot!

Image from code.org

DepED-Division of Lapu-Lapu City 16 TLE/TVL


code blocks from code.org

Solutions:
Increase the number of pixels that the rover moves. Make it higher than the
robot.

code blocks from code.org

Challenge
Instructions
Make the satellite move towards the galaxy!

?
?
Code blocks and images from code.org

DepED-Division of Lapu-Lapu City 17 TLE/TVL


Solution:
The simple solution to this problem is to make the satellite move southwest.
This is better achieved with a small pixel at a time.

code blocks from code.org

DepED-Division of Lapu-Lapu City 18 TLE/TVL


What I Have Learned
These include questions or blank sentences/paragraphs to be filled in
to process what you learned from the lesson.

Self-Check

Directions. Carefully read each item and encircle the correct answer.

1. Which among these codes will create two sprites in a fish tank?

2. A new sprite is created using this:

3. What will make the sprite respond to a tap and move up and down the
screen?

DepED-Division of Lapu-Lapu City 19 TLE/TVE/TVL


4. Where do you think the astronaut will go when clicked?

A. Astronaut moves to the Earth C. Earth move to the rocket


B. Rocket moves to the Earth D. Astronaut move to the rocket
5. Help the astronaut safety back to Earth.

Refer to Answer Key


TLE 8 Exploratory – Technical Drafting 20 DepED-Division of Lapu-Lapu City
What I Can Do
This section provides an activity that will help you transfer your new
knowledge or skill into real-life situations or concerns.

Instruction:

1. Create your fish tank.


2. Draw the fish tank from the code created (refer to the list codes on the
first page on this topic)

Note: Using paper and pen for this task is perfectly fine. You may also log in to
code.org to experiment with different codes until you are satisfied with your fish
tank.

Rating criteria
Criteria 4 Points 3 Points 2 Points 1 Point
Code matches Exact slight big difference No similarities
the fish tank difference
Fish tank Amazing Great very good Good
design
Fish behavior Amazing Great very good Good

TLE 8 Exploratory – Technical Drafting 21 DepED-Division of Lapu-Lapu City


Assessment
This is a task which aims to evaluate your level of mastery in
achieving the learning competency.

Post-test
Test A. Multiple Choice

Directions: Read carefully and select the letter of the correct answer. Please
use a ¼ sheet of paper. Do not write anything on this module.

1. A sprite is:
A. A tiny dots on the screen C. an immovable image
B. An object on the screen to manipulate D. Object that consist of varied
code
2. Which among these is a sprite behavior?
A. Bend C. move
B. Break D. Twist

3. What is the location of this sprite when created?


A. Center C. Lower left corner
B. Lower right corner D. Middle left corner
4. These blocks will make the sprite responds when someone plays with it.
A. Actions C. Behaviors
B. Events D. Sprites
5. Which among these is an action block?

6. What is the location of this sprite?


A. Bottom C. Right
B. Center D. Left
7. Which among these are events in the sprite lab?
A. When Sprite is clicked C. When Sprite is double-clicked
B. When Sprite touches the screen D. When Sprite is NOT clicked

TLE 8 Exploratory – Technical Drafting 22 DepED-Division of Lapu-Lapu City


8. Study the mystery code and predict what will happen to the globe when
the code is run.

A. The sprite will spin. C. The sprite will shrink.


B. The sprite will move. D. The sprite will change color.
9. Study the sprite behavior. Which way will the satellite move towards the sky?

A. Down and then up C. Down and then left


B. Diagonally D. Zig zag
10. Which among these codes will make the Astronaut travel the galaxy until
it disappears?

TLE 8 Exploratory – Technical Drafting 23 DepED-Division of Lapu-Lapu City


Test B. True or False

Directions: Carefully read the statement to determine if it is TRUE or


OTHERWISE. Write T if the statement is true and F if the statement is false.

____1. A virtual pet can be created in the sprite lab.


____2. Sprite lab can only create a fun app.
____3. Sprites can interact with each other.
____4. The sprite color can be changed.
____5. The number of sprites created in the sprite lab is limited to 10
characters.

Refer to Answer Key

TLE 8 Exploratory – Technical Drafting 24 DepED-Division of Lapu-Lapu City


TLE/TVE/TVL 25 DepED-Division of Lapu-Lapu City
Sprites and it’s Behavior
Pre-Assessment True or False Self Check
1. B 6. B 1. F 1. A
2. C 7. A 2. T 2. B
3. B 8. C 3. T 3. A
4. A 9. B 4. F 4. D
5. B 10. D 5. T 5. C
Post-Assessment True or False
1. B 6. B 1. T
2. C 7. A 2. F
3. C 8. C 3. T
4. B 9. B 4. T
5. A 10. D 5. F
Answer Key
References

Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from


https://studio.code.org/s/express-2020/stage/24/puzzle/1?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/2?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/3?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/4?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/5?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/6?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/7?section_id=2719130
Code.org.(2020).Lesson 24 Swimming Fish in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/24/puzzle/8?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/1?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/2?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/3?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/4?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/5?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/6?section_id=2719130
Code.org.(2020).Lesson 25 Alien Dance Party. Retrieved from
https://studio.code.org/s/express-2020/stage/25/puzzle/7?section_id=2719130
Code.org.(2020).Lesson 26 Behaviors in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/26/puzzle/1?section_id=2719130
Code.org.(2020).Lesson 26 Behaviors in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/26/puzzle/2?section_id=2719130
Code.org.(2020).Lesson 26 Behaviors in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/26/puzzle/3?section_id=2719130
Code.org.(2020).Lesson 26 Behaviors in Sprite Lab. Retrieved from

DepED-Division of Lapu-Lapu City 26 TLE/TVE/TVL


https://studio.code.org/s/express-2020/stage/26/puzzle/4?section_id=2719130
Code.org.(2020).Lesson 26 Behaviors in Sprite Lab. Retrieved from
https://studio.code.org/s/express-2020/stage/26/puzzle/5?section_id=2719130
Wikipedia.(2020).Sprite. Retrieved from
https://en.wikipedia.org/wiki/Sprite_(computer_graphics)
Code.org.(2020).Code Studio. Retrieved from
Code.org.(2020).CS Fundamentals 2019/2020/Express. Retrieved from
https://curriculum.code.org/csf-19/express/24/
Code.org.(2020).CS Fundamentals 2019/2020/Express. Retrieved from
https://curriculum.code.org/csf-19/express/25/
Code.org.(2020).CS Fundamentals 2019/2020/Express. Retrieved from
https://curriculum.code.org/csf-19/express/26/
https://www.slideshare.net/lhoralight/music-grade-3
https://www.depedcarifugao.com/kindergarten_q1_week3_FINAL07182020.pdf
https://www.slideshare.net/lhoralight/math-37132231
https://www.officialgazette.gov.ph/1997/06/06/republic-act-no-8293
https://www.officialgazette.gov.ph/1997/06/06/republic-act-no-8293/
https://www.bworldonline.com/copyright-protection-over-the-works-of-the-
government/
http://sei.dost.gov.ph/images/downloads/SiyensyaBilidad2e.pdf
https://archive.org/stream/in.ernet.dli.2015.49160/2015.49160.Indian-Empire-
1891-Vol-3-4_djvu.txt
https://curriculum.code.org/csf-19/coursef/2/
https://www.linkedin.com/learning/illustrator-2020-one-on-one-
fundamentals/introducing-the-home-screen
https://curriculum.code.org/csf-19/pre-express/11
https://curriculum.code.org/csf-19/pre-express/11/
https://curriculum.code.org/csf-19/coursef.pdf
http://www.globalscientificjournal.com/researchpaper/THE_ROCKET_MOVES_FO
RWARD_IN_THE_SPACE_ACCORDING_TO_THE_LAW_ACTION_REACTION_ABSOR
PTION.pdf

TLE 7/8 Exploratory - Carpentry 27 DepED-Division of Lapu-Lapu City


DepED-Division of Lapu-Lapu City 28 TLE/TVE/TVL

You might also like