@ -46,7 +46,7 @@ let obstacles: game.LedSprite[] = []
|
||||
Now generate vertical obstacles consisting of 4 sprites and 1 random hole.
|
||||
Create new variable called `emptyObstacleY`. Using ``||math:pick random||``, generate a random number from `0` to `4` and store it inside `emptyObstacleY`.
|
||||
|
||||
Using ``||loops:for||`` loop, iterate from `0` to `4`. For every coordinate not equal to `emptyObstacleY` create and add obstacle sprites to the endo fo the `obstacles` array.
|
||||
Using ``||loops:for||`` loop, iterate from `0` to `4`. For every coordinate not equal to `emptyObstacleY` create and add obstacle sprites to the end of the `obstacles` array.
|
||||
|
||||
```blocks
|
||||
let emptyObstacleY = 0
|
||||
@ -268,4 +268,4 @@ Here are some additional features you can add to the game:
|
||||
|
||||
## About the authors
|
||||
|
||||
This project was created by [Karolis Vycius](https://www.linkedin.com/in/vycius/). The original Flappy Bird game was developed by [Dong Nguyen](https://en.wikipedia.org/wiki/Flappy_Bird).
|
||||
This project was created by [Karolis Vycius](https://www.linkedin.com/in/vycius/). The original Flappy Bird game was developed by [Dong Nguyen](https://en.wikipedia.org/wiki/Flappy_Bird).
|
||||
|
@ -59,7 +59,7 @@ basic.forever(() => {
|
||||
```
|
||||
**Create the code** that measures the change in the Y axis acceleration as a graph on the LEDs
|
||||
|
||||
**Dowload the code** to the @boardname@
|
||||
**Download the code** to the @boardname@
|
||||
|
||||
**Test the movements that move the graph from 1 to 5 bars on the LEDs**
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
## ~avatar avatar
|
||||
|
||||
Did you know you could attach your headhpones to the @boardname@ to generate sounds?
|
||||
Did you know you could attach your headphones to the @boardname@ to generate sounds?
|
||||
|
||||
## ~
|
||||
|
||||
|
@ -81,7 +81,7 @@ The hunter's screen will display:
|
||||
|
||||
Use the ``signal`` values collected in the previous step to determine when to show each icon.
|
||||
|
||||
Here is an example that uses ``-95`` or less for cold, between ``-95`` and ``-80`` for warm, and ``-80`` or above for hot. You can change these values to account for your room setup or conditions of your hidding place.
|
||||
Here is an example that uses ``-95`` or less for cold, between ``-95`` and ``-80`` for warm, and ``-80`` or above for hot. You can change these values to account for your room setup or conditions of your hiding place.
|
||||
|
||||
To make the program more responsive, add a ``||led:stop animation||`` to cancel icon animations when a new beacon packet comes in.
|
||||
|
||||
@ -180,4 +180,4 @@ radio.setGroup(1)
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
||||
```
|
||||
|
@ -17,7 +17,7 @@ https://youtu.be/BiZLjugXMbM
|
||||
## Materials
|
||||
|
||||
* 3 Coffee cup holders (hot cup sleeves)
|
||||
* 2 Wood coffee strirer sticks
|
||||
* 2 Wood coffee stirrer sticks
|
||||
* Glue gun
|
||||
* Scissors that can cut cardboard
|
||||
* 1 @boardname@, battery holder and 2 AAA batteries
|
||||
|
@ -13,7 +13,7 @@ Turn some coffee cup holders into a monster that moves to light!
|
||||
## Materials
|
||||
|
||||
* 3 coffee cup holders (hot cup sleeves)
|
||||
* 2 ood coffee strirer sticks
|
||||
* 2 wood coffee stirrer sticks
|
||||
* scissors
|
||||
* glue gun or tape
|
||||
* 1 paper clip
|
||||
@ -24,4 +24,4 @@ TODO
|
||||
|
||||
## ~button /projects/light-monster/code
|
||||
NEXT: Code
|
||||
## ~
|
||||
## ~
|
||||
|
@ -19,7 +19,7 @@ Happy mining!
|
||||
|
||||
## Coins, blocks, chains
|
||||
|
||||
A _block chain_ is a list of _blocks_ that record transactions of a crypto-currency like BitCoin. A block might contain information like the time it was created (mined) and who mined it. The most important part of the block is it's _hash_. This is a special number made from the information in the last block of the block list combined with the hash number of previous block in the list. The new block contains information for the current transaction and this new hash number. The new block is added to the list of previous blocks. This list is then transmitted to the crypto currency network. It's really hard (like impossible) to tamper or forge a hash which allows the block chain to be transmitted publically.
|
||||
A _block chain_ is a list of _blocks_ that record transactions of a crypto-currency like BitCoin. A block might contain information like the time it was created (mined) and who mined it. The most important part of the block is it's _hash_. This is a special number made from the information in the last block of the block list combined with the hash number of previous block in the list. The new block contains information for the current transaction and this new hash number. The new block is added to the list of previous blocks. This list is then transmitted to the crypto currency network. It's really hard (like impossible) to tamper or forge a hash which allows the block chain to be transmitted publicly.
|
||||
|
||||
## ~ hint
|
||||
|
||||
@ -84,4 +84,4 @@ The [radio-blockchain](https://makecode.microbit.org/pkg/microsoft/pxt-radio-blo
|
||||
```package
|
||||
radio
|
||||
radio-blockchain=github:Microsoft/pxt-radio-blockchain#v0.1.4
|
||||
```
|
||||
```
|
||||
|
@ -20,7 +20,7 @@ https://youtu.be/Ah4fEbJtklU
|
||||
## Recycled
|
||||
|
||||
* 1 Milk Carton **without a screwable cap**
|
||||
* 2 Coffee stiring wood sticks
|
||||
* 2 Coffee stirring wood sticks
|
||||
* 2 Straws
|
||||
* 2 clothespin (optional, can be replaced by glue)
|
||||
|
||||
|
@ -9,7 +9,7 @@ Remote control your Milk Carton Robot with another @boardname@
|
||||
## Duration: ~30 minutes
|
||||
|
||||
You will need 2 @boardname@ for this part. By using the radio, we can make the Milk Carton Monster controlled by another @boardname@.
|
||||
Download the code below to the @boardname@ on the Milk Carton Monster and another "controller" @boardname@. Whenere ``A`` is pressed, the Milk Carton Monster will move once.
|
||||
Download the code below to the @boardname@ on the Milk Carton Monster and another "controller" @boardname@. Whenever ``A`` is pressed, the Milk Carton Monster will move once.
|
||||
|
||||
```blocks
|
||||
radio.onReceivedNumber(({ receivedNumber }) => {
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||

|
||||
|
||||
Build a multi-player dice game using the **radio**. The **radio** blocks let you send wireless messages between a @boardnam@ and another @boardname@.
|
||||
Build a multi-player dice game using the **radio**. The **radio** blocks let you send wireless messages between a @boardname@ and another @boardname@.
|
||||
|
||||
In this game, you shake to "throw the dice" and send the result to the other @boardname@. If you receive a result of a dice throw equal or greater than yours, you lose.
|
||||
|
||||
@ -92,4 +92,4 @@ radio.onReceivedNumber(function (receivedNumber) {
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
||||
```
|
||||
|
@ -139,7 +139,7 @@ start = 0
|
||||
|
||||
## Step 6: Plot LED on X, Y coordinates randomly
|
||||
|
||||
The reaction time will begin if no false start is detected (pin **P0** pressed at the wrong time). When the reaction time starts, a LED is randomly plotted at some the x and y coordinate on the display. Add in the blocks contatined in the ``||logic:if then||`` that show the reaction time:
|
||||
The reaction time will begin if no false start is detected (pin **P0** pressed at the wrong time). When the reaction time starts, a LED is randomly plotted at some the x and y coordinate on the display. Add in the blocks contained in the ``||logic:if then||`` that show the reaction time:
|
||||
|
||||
```blocks
|
||||
let start = 0
|
||||
|
@ -206,7 +206,7 @@ Make sure to rename this program to ``player`` or something like that so you don
|
||||
|
||||
### Tuning
|
||||
|
||||
Does the movement check work? Try changing the ``100`` value to tune the detection sensivity. Try ``64`` maybe.
|
||||
Does the movement check work? Try changing the ``100`` value to tune the detection sensitivity. Try ``64`` maybe.
|
||||
|
||||
### Improve the game
|
||||
|
||||
@ -216,4 +216,4 @@ Does the movement check work? Try changing the ``100`` value to tune the detecti
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
||||
```
|
||||
|
@ -11,7 +11,7 @@ https://youtu.be/8ztOmdZi5Pw
|
||||
Playing rock paper scissors is usually a two player game... but it will work with many more players too!
|
||||
When playing with more than two players, it becomes a team game: all players shake at the same time,
|
||||
then the amount of **rocks**, **paper**, and **scissors** is tallied between all the players.
|
||||
Teams are formed automatcally based on which tool is chosen by shaking the @boardname@. The team with the most players after the shake wins the game.
|
||||
Teams are formed automatically based on which tool is chosen by shaking the @boardname@. The team with the most players after the shake wins the game.
|
||||
|
||||
Starting with the [basic version of the RPS game](/projects/rock-paper-scissors), we are going
|
||||
to change the code so that the @boardname@ counts and displays the number of players on a team.
|
||||
@ -151,7 +151,7 @@ radio.onReceivedNumber(function (receivedNumber) {
|
||||
})
|
||||
```
|
||||
|
||||
## Step 6: Reseting the team
|
||||
## Step 6: Resetting the team
|
||||
|
||||
What if some of the other players leave the game? They would stop broadcasting their status but would still stay in our list of players. To avoid this problem, we reset the ``players`` array each time we shake:
|
||||
|
||||
@ -222,4 +222,4 @@ radio.setTransmitSerialNumber(true)
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
||||
```
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Salute!
|
||||
|
||||
**Salute!** is a simple math game where players select a number card from a deck (without looking at it) and hold it to their forehead as in a "salute". Another player decides whether to make a sum or product of the two cards and then annouces the result. Based on the card held by the opposing player and the result announced, each player tries to figure out what card they are holding.
|
||||
**Salute!** is a simple math game where players select a number card from a deck (without looking at it) and hold it to their forehead as in a "salute". Another player decides whether to make a sum or product of the two cards and then announces the result. Based on the card held by the opposing player and the result announced, each player tries to figure out what card they are holding.
|
||||
|
||||
## Goals for this activity
|
||||
|
||||
@ -126,4 +126,4 @@ Also, watch this video to see how the game is played:
|
||||
https://www.youtube.com/watch?v=DJBMbSUGZsc
|
||||
How to Play Salute!
|
||||
|
||||
This math game project was kindly contributed by [Vicky Sedgwick](https://about.me/vicky.sedgwick). It's based on the original game concept created by [Todd Lash](https://twitter.com/Todd_Lash).
|
||||
This math game project was kindly contributed by [Vicky Sedgwick](https://about.me/vicky.sedgwick). It's based on the original game concept created by [Todd Lash](https://twitter.com/Todd_Lash).
|
||||
|
@ -61,7 +61,7 @@ We want our soil probes to work for a long time and to save our battery power, s
|
||||
|
||||
* Our circuit connects directly to the **3V** pin so it is always using electricity. Instead,
|
||||
we will connect it to **P1** and turn that pin **high** only while the measurement is taken.
|
||||
This saves electricty and also avoids corrosion of the probes.
|
||||
This saves electricity and also avoids corrosion of the probes.
|
||||
* We will also lower the brightness of the screen to lower the energy consumption from the LEDs.
|
||||
* Soil moisture changes very slowly so we don't need to measure it all the time!!! Let's add a **sleep** of 5 seconds in the loop as well.
|
||||
|
||||
@ -91,4 +91,4 @@ basic.forever(() => {
|
||||
|
||||
Connect
|
||||
|
||||
## ~
|
||||
## ~
|
||||
|
@ -24,7 +24,7 @@ led.plot(2, 2)
|
||||
## Step 3
|
||||
|
||||
Now that we know how to send the signal, we only want to do it while the button **A** is pressed.
|
||||
Pick an ``||logic:if then else||`` block from the **Logic** drawer (you'll leave the ``||logic:else||`` part empty for now). Add a check for when button **A** is pressed. Get an ``||inpu:on button pressed||`` from the **Input** drawer and move the blocks from the previous step into ``||logic:then||`` part of the ``||logic:if then else||``:
|
||||
Pick an ``||logic:if then else||`` block from the **Logic** drawer (you'll leave the ``||logic:else||`` part empty for now). Add a check for when button **A** is pressed. Get an ``||input:on button pressed||`` from the **Input** drawer and move the blocks from the previous step into ``||logic:then||`` part of the ``||logic:if then else||``:
|
||||
|
||||
```blocks
|
||||
if (input.buttonIsPressed(Button.A)) {
|
||||
|
@ -30,7 +30,7 @@ By dividing the distance between the gates by the duration, we get the speed of
|
||||
|
||||
## Materials
|
||||
|
||||
* Carboard
|
||||
* Cardboard
|
||||
* Aluminum foil
|
||||
* Double-side tape (carpet tape)
|
||||
* 4 crocodile clips
|
||||
@ -227,4 +227,4 @@ Measure the distance between the gates and apply Newton's laws to compute the ve
|
||||
|
||||
v = d / t
|
||||
|
||||
We'll let you try to code this one on your own!
|
||||
We'll let you try to code this one on your own!
|
||||
|
@ -53,7 +53,7 @@ Gently fold the sheet in half.
|
||||
|
||||

|
||||
|
||||
Gently foldy the other way.
|
||||
Gently fold the other way.
|
||||
|
||||

|
||||
|
||||
|
@ -14,7 +14,7 @@ We need to make some variables to keep track of the time and for a few other thi
|
||||
2. Ok, in **Variables** click on `Make a Variable`. Name the variable as `hours`. Drag out a ``||variables:set to||`` block and change the name with the dropdown to `hours`. Place the variable into the ``||basic:on start||`` block.
|
||||
3. Repeat this 4 more times to make variables named `minutes`, `time`, `adjust`, and `ampm`.
|
||||
4. Now, for the ``||variables:set to||`` block for `time`, go to **Text** and drag a `" "` in and replace the `0`.
|
||||
5. For the `ampm` variable, change the `0` there to a `false` from the **Logic** catagory.
|
||||
5. For the `ampm` variable, change the `0` there to a `false` from the **Logic** category.
|
||||
|
||||
```blocks
|
||||
let hours = 0
|
||||
@ -28,7 +28,7 @@ let ampm = false
|
||||
|
||||
So, let's try showing the time on the display. We aren't keeping time yet but we'll just see if we can make our watch show something.
|
||||
|
||||
1. Get in the **Input** catagory and pull out an ``||input:on shake||``. We'll have our watch show the time when it's shaken.
|
||||
1. Get in the **Input** category and pull out an ``||input:on shake||``. We'll have our watch show the time when it's shaken.
|
||||
2. Get another ``||variables:set to||`` and put it into the ``||input:on shake||``. Change the name to `time`.
|
||||
3. Replace the `0` with a ``||text:join||`` from **Text**. Get another ``||text:join||`` and put it into the second slot of the first ``||text:join||`` you pulled out.
|
||||
4. Change the `" "` in the first ``||text:join||`` to the `hours` variable. Change the text in the first slot of the second ``||text:join||`` to `":"`. And, change the last slot in the second ``||text:join||`` to the `minutes` variable.
|
||||
@ -52,8 +52,8 @@ Let's make a way to set the hours for the watch.
|
||||
|
||||
1. In **Input**, find an ``||input:on button pressed||`` an put it somewhere on the workspace.
|
||||
2. Get an ``||logic:if then else||`` block from **Logic** and put it in the ``||input:on button pressed||``.
|
||||
3. From the same **Logic** category, get a ``||logic:0 < 0||`` and relpace the `false` condition with it.
|
||||
4. Change the left `0` in the condtion to the `hours` variable. Change `0` on the right to `23`. This limits our hour count to 23 hours.
|
||||
3. From the same **Logic** category, get a ``||logic:0 < 0||`` and replace the `false` condition with it.
|
||||
4. Change the left `0` in the condition to the `hours` variable. Change `0` on the right to `23`. This limits our hour count to 23 hours.
|
||||
5. In the ``||logic:then||`` section, put a ``||variables:change by||`` there. Select the `hours` variable name from the dropdown.
|
||||
6. In the ``||logic:else||`` section, put a ``||variables:set to||`` there. Select the `hours` variable name from the dropdown and leave the `0`.
|
||||
|
||||
@ -266,4 +266,4 @@ Right now, it's showing 24 hour format: hours go from `0` to `23` and back to `0
|
||||
|
||||
To set it to the current time, you use the **A** and **B** buttons. The **A** button moves the current hour up by one each time it's pressed. The **B** button moves the minutes up by one every time it's pressed.
|
||||
|
||||
Now that you can tell time on your @boardname@ who knows what you will accomplish next. Only, time will tell!
|
||||
Now that you can tell time on your @boardname@ who knows what you will accomplish next. Only, time will tell!
|
||||
|
@ -28,8 +28,8 @@ We'll use button `A` to add `10` seconds to our time count. The time count of `s
|
||||
|
||||
1. In **Input**, find an ``||input:on button pressed||`` an put it somewhere on the workspace.
|
||||
2. Get an ``||logic:if then||`` block from **Logic** and put it in the ``||input:on button pressed||``.
|
||||
3. From the same **Logic** category, get a ``||logic:0 < 0||`` and relpace the `false` condition with it.
|
||||
4. Change the left `0` in the condtion to the `seconds` variable. Change `0` on the right to `50`. This limits time to just one minute.
|
||||
3. From the same **Logic** category, get a ``||logic:0 < 0||`` and replace the `false` condition with it.
|
||||
4. Change the left `0` in the condition to the `seconds` variable. Change `0` on the right to `50`. This limits time to just one minute.
|
||||
5. In the ``||logic:then||`` section, put a ``||variables:change by||`` there. Select the `seconds` variable name from the dropdown and change the `0` on the right to `10`.
|
||||
6. Add a ``||basic:show number||`` below the ``||variables:change by||``. Change the value to the `seconds` variable. Then, put a ``||basic:clear screen||`` under that.
|
||||
|
||||
@ -50,8 +50,8 @@ Now, we'll use the `B` button to add just `1` second the time count. The time co
|
||||
|
||||
1. In **Input**, find an ``||input:on button pressed||`` an put it somewhere on the workspace.
|
||||
2. Get an ``||logic:if then||`` block from **Logic** and put it in the ``||input:on button pressed||``.
|
||||
3. From the same **Logic** category, get a ``||logic:0 < 0||`` and relpace the `false` condition with it.
|
||||
4. Change the left `0` in the condtion to the `seconds` variable. Change `0` on the right to `60`. Again, this limits the time to just one minute.
|
||||
3. From the same **Logic** category, get a ``||logic:0 < 0||`` and replace the `false` condition with it.
|
||||
4. Change the left `0` in the condition to the `seconds` variable. Change `0` on the right to `60`. Again, this limits the time to just one minute.
|
||||
5. In the ``||logic:then||`` section, put a ``||variables:change by||`` there. Select the `seconds` variable name from the dropdown.
|
||||
6. Add a ``||basic:show number||`` below the ``||variables:change by||``. Change the value to the `seconds` variable. Then, put a ``||basic:clear screen||`` under that.
|
||||
|
||||
@ -107,4 +107,4 @@ input.onGesture(Gesture.Shake, () => {
|
||||
|
||||
Nice! You've got your timer coded now. Go press the ``|Download|`` button and put your code on the @boardname@. When you shake it, it counts down from the time you have set.
|
||||
|
||||
At first, there are zero seconds set. To add ten seconds to the count, press the **A** button. To increase the count by one second, press the **B** button.
|
||||
At first, there are zero seconds set. To add ten seconds to the count, press the **A** button. To increase the count by one second, press the **B** button.
|
||||
|
Reference in New Issue
Block a user