You are on page 1of 12

Date : 6/3/2023

Grade : 6b
Time : 1.40pm
TEACHER : Wasfia Inayat

CHAPTER 4: PROGRAMMING
THE FROG MAZE
PAGE#61
4.4:
MOVEMENT MODULE
What is module in programming?
A module is a section of code that is added in as a whole or is designed for
easy reusability.

EXPLANATION:
A module is a software component or part of a program that contains one or
more routines. One or more independently developed modules make up a
program. An enterprise-level software application may contain several different
modules, and each module serves unique and separate business operations.

Modules make a programmer's job easy by allowing the programmer to focus


on only one area of the functionality of the software application. Modules are
typically incorporated into the program (software) through interfaces.
What is a real life example of modularity?
A modular device has several parts that serve smaller
functions which combine to serve the overall purpose of
the device. Modules can be removed, replaced, or
upgraded without affecting other components. For
example, most desktop computers are modular because
they have easily removable and upgradeable parts
Modular Coding in Sctracth Programming:
• Create complex projects faster.

• Change code easily.

• Make your code more reliable.


MODULES:
• 3D TITLE GROW
• LANDSCAPE OUTLINE WALKER
• ROCKET CONTROL AND CRASH IN A SCROLLING BACKGROUND
• TURN/FORWARD ROCKET CONTROL IN A STATIC BACKGROUND
• UP/DWN/LT/RT ROCKET CONTROL IN A STATIC BACKGROUND
• GAME TIMER
• ALARM CLOCK
• ANIMATED FLYING BIRD
AVATAR CREATOR
VOICE RECOGNITION
MOUSE FOLLOWER
JUMPING OBJECT
What are called commands?
A command is a specific instruction given to a
computer application to perform some kind of
task or function.
 

Arrow keys:
For the code shown below, consider the following:
Since we’re using “Change x by” and “Change y by”, we’re going to be moving the
sprite relative to its current position.
In Scratch’s convention, up is positive y, down is negative y, left is negative x, and
right is positive x.
As you might have guessed, the larger the “Change x by” or “Change y by” number
is, the further, and thus faster, the sprite will move.
If we’re making a 2D side scroller, we might consider only allowing left and right
movement, that is, movement in the negative x and positive x directions.
1.movement in the negative x and positive x directions.

You might also like