2016-03-25 16:47:20 -07:00
# catch the egg game lesson
2016-04-01 16:22:47 -07:00
A game to catch eggs in a basket.
2016-03-25 16:47:20 -07:00
## Topic
Variables
## Quick Links
2016-04-13 08:27:45 -07:00
* [activity ](/lessons/catch-the-egg-game/activity )
2018-11-05 09:07:50 -08:00
* [challenge ](/lessons/catch-the-egg-game/challenge )
2016-04-13 08:27:45 -07:00
* [quiz ](/lessons/catch-the-egg-game/quiz )
* [quiz answers ](/lessons/catch-the-egg-game/quiz-answers )
2016-03-25 16:47:20 -07:00
## Prior learning/place of lesson in scheme of work
2018-11-09 15:36:46 -08:00
Learn how to create a catch the egg game game with ``||led:plot||`` , ``||led:unplot||``, and ``||input:acceleration||` ` to turn on and off LED lights on the screen.
2016-03-25 16:47:20 -07:00
## Documentation
2018-11-09 15:36:46 -08:00
The blocks used in this lesson:
2016-05-09 10:32:02 -07:00
```cards
let x = 2;
led.unplot(0, 0);
basic.forever(() => {});
x += 1;
led.plot(0, 0);
basic.pause(300);
input.acceleration(Dimension.X);
Math.min(0,0);
Math.max(0,1);
2018-11-05 09:07:50 -08:00
Math.randomRange(0, 4);
2016-05-09 10:32:02 -07:00
game.addScore(1);
game.score();
game.removeLife(1);
```
2016-03-25 16:47:20 -07:00
## Objectives
2016-03-30 16:32:16 -07:00
* learn how to create a 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
2016-03-25 16:47:20 -07:00
* learn how to repeat code in the background forever
* learn how to turn off a LED light on the LED screen
* learn how to turn on a LED light on the LED screen
* learn how to learn how to conditionally run code depending on whether a condition is true or not
* learn how to learn how to get the acceleration value (g-force), in one of three specified dimensions
* learn how to return the smaller of two numbers
* learn how to return the larger of two numbers
* learn how to return a random number
* learn how to return the modulus
2016-11-01 10:42:42 -07:00
* learn how to show a number of the @boardname @ screen
2016-03-25 16:47:20 -07:00
* learn how to pause your code for the specified number of milliseconds