0% found this document useful (0 votes)
38 views18 pages

Chapter 5 Block Programming

Uploaded by

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

Chapter 5 Block Programming

Uploaded by

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

学习图形化编程

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

These numbers can be ranked (from small to large) as follow


-∞, -999999, -137, -23.6, -9, -1, -0.2351, 2.6, 20, 326, 968, 999999, ∞
Number line

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.

The number mentioned before could be show as:


-∞, -999999, -137, -23.6, -9, -1, -0.2351, 2.6, 20, 326, 968, 999999, ∞
-1 2.6 326

-∞ ∞
-999999 -137 -23.6 -9 0 20 968 999999

-0.2351
X axis and Y axis

The center of the stage is the origin(coordinate is: 0,0)


X-axis: the right side is positive numbers, and the left
side negative
Y-axis: the above side is positive numbers, and the
below side negative

Two-dimensional coordinate
Coordinate system

In geometry, a coordinate system is a system that uses one or more

Z numbers, or coordinates, to uniquely determine the position of the points


or other geometric elements on a manifold.
Y LiteBee introduces the coordinate system to locate the position of the
drone, take the drone as origin, the X-axis for left-right, the Y-axis for
forward-backward, and the Z-axis for up-down.

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!
Questions

• 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

• 1 ) To draw a coordinate with X-axis and Y-axis on the stage


• 2 ) Move Wing to the position(15, 15) , and then execute the “move 10 steps” watching what happened
• 3 ) Move Wing to the box as the picture shows, and tell the coordinate of the position
Extended practice

• Draw a maze by yourself and move Wing out of it.


• Attention: Wing is not allowed to reach the “wall” of the
maze , and can only go ahead (make a turn by changing
orientation).
Tips :
1. To draw the maze in the backdrop
2. Apply the block “when X key pressed” in the “Event”
3. Apply the “Motion” blocks to calculate the distance and to
switch the direction
4. To keep the nose ahead: apply the block “turn left/right x
degree” in the “Motion”
5. Avoid touch the “wall”: apply the “shrink” in the toolbar
Programming
THANKS

THANKS

You might also like