Professional Documents
Culture Documents
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.
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.