pxt-calliope/docs/reference/js/lessons/bop-it.md
2016-03-25 16:47:20 -07:00

98 lines
4.4 KiB
Markdown

# bop it lesson
a game where you have to keep up with the commands #var #data #if #random #min #max #mod #plot #unplot #pause #accceleration #docs
## Topic
Game Library
## Quick Links
* [tutorial](/microbit/lessons/bop-it/tutorial)
* [quiz](/microbit/lessons/bop-it/quiz)
* [quiz answers](/microbit/lessons/bop-it/quiz-answers)
* [challenges](/microbit/lessons/bop-it/challenges)
## Class
Year 7
## Prior learning/place of lesson in scheme of work
Learn how to create a minesweeper game with **if**, `if condition do` , **global variables** to keep track of the action that the player is asked to perform. We will be learning how to create a bop it game using functions, global variables, if (conditionals), input on button pressed, math random, logo down, add score, as well as simple commands such as show string.
## Documentation
* **game library** : [read more...](/microbit/js/game-library)
* **global variables** : [read more...](/microbit/js/data)
* **assignment operator** : [read more...](/microbit/reference/variables/assignment)
* **functions** : [read more...](/microbit/js/function)
* **call** : [read more...](/microbit/js/call)
* **math random number** : [read more...](/microbit/js/math)
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
* **on logo down** : [read more...](/microbit/functions/on-logo-down)
* **on shake** : [read more...](/microbit/reference/input/on-gesture)
* **if** : [read more...](/microbit/reference/logic/if)
* **show number** : [read more...](/microbit/reference/basic/show-number)
* **show string** : [read more...](/microbit/reference/basic/show-string)
## Objectives
* learn how the game library supports single-player, time-based games: a game library supports setting a number of lives, score, countdown clock, and levels.
* learn how to create a global variable as a place where you can store data so that you can use it later in your code, accessible across functions and in nested code blocks
* learn how the assignment operator is used to declare a new variable or update the value of a variable
* learn how to create a function as a unit of code that performs a specific task and returns a result to make the code easier to read, debug, and update
* learn how to call an existing function in the script
* learn how to return a random number
* learn how to run code when an input button is pressed
* learn how to run code when the BBC micro:bit is oriented perpendicularly to the floor with the logo down
* learn how to run code when the BBC micro:bit is shaken; when running code in the web browser, moving the mouse quickly simulates shaking
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show a string of the LED screen one character at a time (scrolling left to right)
* learn how to show a number on the LED screen one digit at a time (scrolling left to right)
## Links to the National Curriculum Programmes of Study for Computing
## Progression Pathways / Computational Thinking Framework
#### Algorithms
* Designs solutions (algorithms) that use repetition and two-way selection, ie if, then and else.(AL)
* Uses logical reasoning to predict outputs, showing an awareness of inputs (AL)
* Represents solutions using a structured notation (AL) (AB)
#### Programming & Development
* Creates programs that implement algorithms to achieve given goals (AL)
* Declares and assigns variables(AB)
* Understands the difference between, and appropriately uses if and if, then and else statements(AL)
* Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)
* Selects the appropriate data types(AL) (AB
#### Data & Data Representation
* Understands the difference between data and information(AB)
* Performs more complex searches for information e.g. using Boolean and relational operators(AL) (GE) (EV)
#### Hardware & Processing
* Knows that computers collect data from various input devices, including sensors and application software (AB)
Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algorithmic Thinking; EV = Evaluation; GE = Generalisation
## Activity
* time: 20 min.
* [tutorial](/microbit/lessons/bop-it/tutorial)
* [quiz](/microbit/lessons/bop-it/quiz)
## Extended Activity
* time: 20 min.
* [challenges](/microbit/lessons/bop-it/challenges)
## Homework
* Extended Activity: [challenges](/microbit/lessons/bop-it/challenges)