Added animations, corrected typo

Added Battleship examples, animated firework and cascade screensaver
examples, and added a missing period.
This commit is contained in:
dkiang 2017-08-01 12:05:09 -07:00
parent 8431201ed0
commit 9510ec862e
9 changed files with 11 additions and 4 deletions

View File

@ -1,11 +1,13 @@
# Coordinate grid and LEDs
This lesson introduces the use of coordinates to store data or the results of mathematical operations. It gives students practice programming for the LEDs of the micro:bit screen using coordinates. And introduces the basic game blocks of MakeCode.
![Sample Heart Simulator](/static/courses/csintro/coordinates/cover.png)
This lesson introduces the use of coordinates to store data or the results of mathematical operations. It gives students practice programming for the LEDs of the micro:bit screen using coordinates, and introduces the basic game blocks of MakeCode.
## Lesson objectives
Students will...
* Understand that the 5 x 5 grid of LEDs on the micro:bit represent a coordinate grid with the origin (0,0) in the top left corner.
* Understand that the 5 x 5 grid of LEDs on the micro:bit represents a coordinate grid with the origin (0,0) in the top left corner.
* Understand that the values of the x coordinates range from 0 through four and increase from left to right.
* Understand that the values of the y coordinates range from 0 through four and increase from top to bottom.
* Learn how to refer to an individual LED by its x & y coordinates.

View File

@ -109,7 +109,7 @@ Check the on/off state of an LED
* If the LED is currently off, the point x y block will return false.
* For this exercise, well use the two Yes/No built in icons to display the LEDs current status. From the Basic Toolbox drawer, drag 2 'show icon' blocks into each of the 'then' and 'else' clauses. Select the check mark for Yes, and the X icon for No.
* For now, well leave the default coordinate values (0,0). But you can challenge your students to add a loop to test for all coordinates on the micro:bit
* For now, well leave the default coordinate values (0,0). But you can challenge your students to add a loop to test for all coordinates on the micro:bit.
Here is the complete program:

View File

@ -19,6 +19,7 @@ Your project might use variables to store the values of sprites, which are speci
## Project Ideas
![Firework Example](/static/courses/csintro/coordinates/firework.gif)
### Firework screensaver
This project uses a for loop with the plot/unplot blocks to create a symmetrical design on the screen. This student used a subtraction operation to get a variable that decreases as the index variable in the loop increases.
@ -40,6 +41,7 @@ basic.forever(() => {
})
```
![Player Grid Example](/static/courses/csintro/coordinates/cascade.gif)
### Cascade screensaver
This example creates a diagonal cascading effect across the screen. Note the use of a variable (speed) to allow you to easily change the speed of the animation by changing just one number value.

View File

@ -7,7 +7,8 @@ To help us practice using the correct coordinates for the grid of micro:bit LEDs
Have students make their own sets of 5x5 grids to reinforce the layout of the micro:bit grid.
Each student should make two grids. One grid is for placing their own ships and keeping track of their opponents hits and misses and the other grid is for keeping track of their own hits and misses while trying to determine the location of their opponents ships.
 
![Player Grid Example](/static/courses/csintro/coordinates/player-grid.png)
Players grid: Mark where your ships are and keep track of your opponents hits and misses.
```
@ -18,6 +19,8 @@ Players grid: Mark where your ships are and keep track of your opponents h
(0,4) (1,4) (2,4) (3,4) (4,4)
 
```
![Opponent Grid Example](/static/courses/csintro/coordinates/opponent-grid.png)
Opponents grid: Keep track of your hits and misses while trying to locate your opponents ships.
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB