Chapter 5 Block Programming
Chapter 5 Block Programming
Block
programming
Play a game
Everybody move forward for 5 steps, then backward for 6 steps, right for 4
steps, then turn left for 45 degree, at last, move left for 3steps.
Start programming
By programming, let the Wing in the software move as the following steps: go right for 80 steps,
go left for 150 steps, go forwards for 50 steps, and go backward for 150 steps
Tips:
1 ) Program Startup
2 ) Move right for 80 steps
3 ) Move left for 150 steps
4 ) Move forward for 50 steps
5 ) Move backward for 150 steps
6 ) Standby
Positive/negative numbers
There are positive numbers and negative numbers, and the positive number is those numbers
greater than 0; the negative less than 0; 0 is neither positive nor negative number. The positive
numbers are as the number we used daily, but the negative number is always with a symbol “-”
in front of it.
For example:
526, -999999, 250, -37, -23.6, 968, 2.6, -9, 999999, ∞(infinity), -0.2351, -1
Number line:
In elementary mathematics, a number line is a picture of a graduated straight line that serves
as an abstraction for real numbers. Every point of a number line is assumed to correspond to
a real number, and every real number to a point.
-∞ ∞
-999999 -137 -23.6 -9 0 20 968 999999
-0.2351
X axis and Y axis
Two-dimensional coordinate
Coordinate system
0
X
Three-dimensional coordinate
1. Move right
Select the Motion from the “Blocks” to program the movement of the Wing.
Drag the “change x by 10” to the Script area, and set the value as 80
1. Move left
If changing the x value to 80 is to move right 80, then how to move left?
Drag the block “change x by 10” to the script area, set the value as -150
3. Move forward and backward
Select the Motion from the “Blocks” to program the movement of the Wing.
Move forward: Drag the “change y by 10” to the Script area, and set the value as 50
Move backward: Drag the “change y by 10” to the Script area, and set the value as -150
Standby
Click the “Control”, and drag the “stop _all” to the script area.
For reference
• After setting every block, drag them together as the order. Click the green flag on the right-top
of the stage, and see what happens!
• The sprite runs too fast to watch its route. How can we track its route?
• Is it possible to replace the startup block with others?
Programming
• Apply the “wait 1 sec” of the “Control” to slow the plane down.
• The “Pen” could help us to track the route of the plane, just as the coding shows.
• Do it yourself, and see what happen ?
Discussion
THANKS