DAY 5: The final battle
It is well known that pirates like to fight just for fun.
1. Introductory unplugged activity
Build an unbreakable treasure chest
There is a lot to do to get ready for the battle. First the team has to build an unbreakable treasure chest that looks awesome and that contains the heart of their captain.
2. Microbit activity
Add technological security features to your treasure chest
The treasure chest can be opened only if every team member puts in his/her coin. The chest is also equiped with an alarm system that warns the team if it has been opened. The team has to write two different microbit programs to achieve these functionnality. They will work in teams of two to achieve this goal by them selves.
+ TODAY WE LEARN:
1. How to we use buttons to increment and decrement a variable?
2. How to use conditionals
3. How to create a sound alarm
4. Use the radio to send an alarm message
There are two microbits to program:
- A coin counter for opening the chest. Press a increments the counter by one, pressing B decrements de counter by 1 and pressing A+B resets the counter. When counter is greater then 7, a message is sent by radio to the alarm.
- A microbit that produces an alarm sound when it receives a message.
2.1 Blocks Code

2.2 Text Code
Emitter
let coins = 0
input.onButtonPressed(Button.A, () => {
coins += -1
})
input.onButtonPressed(Button.AB, () => {
coins = 0
})
input.onButtonPressed(Button.B, () => {
coins += 1
})
coins = 0
radio.setGroup(1)
basic.forever(() => {
if (input.magneticForce(Dimension.Strength) > 400) {
basic.pause(500)
coins += 1
}
basic.showNumber(coins)
if (coins >= 7) {
radio.sendNumber(0)
}
})
Reciever
let time = 0
radio.onDataPacketReceived( ({ receivedNumber }) => {
for (let i = 0; i <= 30; i++) {
music.playTone(277 + i * 5, time)
}
})
radio.setGroup(1)
time = 20
Feed back of tests with KCJ team (22-06-2018):
- Important: Mantain separated Magnets from Microbits
- Because we used strong magnets, microbits were affected by the strong magnetic fields!
2b. Artbit - code for begginers
No Artbit activity for this day. We prepare for the Capture the Flag game by decorating our treasure chest.
3. Final battle: capture the heart of the captain
The final battle is in three stages:
PREPARATION: 0. Draw two large circles on the grass to delineated the safe zones
- Give each player a fla that they attach to their waist
- Put a treasure chest in the middle of each save zone with a ball inside representing the heart of the captain
- Give each player a golden coin
- An instructor is posted at each chest to act as the keeper of the chest
OPENING THE CHEST
- To open the chest every player has to enter the safe zone of the opposite team and give his coin to the keeper of the chest.
- The other team can defend by pulling the attackers flag
- Once an attacker has lost his flag, he has to go back to its base to put another one.
- Once the coin counter is greater then 7, the alarm goes off, the keeper releases the heart of the captain for the attacker to take it.
BRING THE HEART BACK TO SAFETY
- The attackers have to bring the heart back to their safe zone.
- They can throw the ball to each other
- If the attacker in possession of the ball gets his flag taken, the game ends.
- If the ball is intercepted by the defenders, the game ends.
- The winner of the round is the team that successfully brings the captain's heart back to their base.
Rules:
- No more than one coin per person in their possession
- Maximum of 1 person in the zone each time
- Opening the chest gives 1 point
- You need to have a flag attached to you to give your coin
- No one can take your flag if you are in a safe zone.
- Bringing the heart back give an extra 1 point
- Only one chest can be opened at a time.
- You cannot take the ball in the hands of another players
Kids define their own strategy on how to capture the Heart of the captain
4. Conclusions
Young kids (age 5 to 8)
The capture the flag game was to complex for the smaller kids. We need to design a simplified version of the game for them.
Older kids (age 8 to 12)
We let the kids do the project by them selves without any demonstration. They had all the elements to do it by the end of the week (radio, buttons, variables, conditionals) and every team made it.
The final game is complex. It is a challenge to explain it and to make it work properly. After a first experimentation stage, the rules of the game are now more clear. It is a good game because the kids can try to make up a strategy.
Improvements to the game:
- Different alarms for each team
- Every kids puts their t-shirt in their pants before putting the flag
- Make sure the microbit have enough radio range to reach the alarm
5. General Conclusions
Authors: B.Ferragut and D.Banville - June 2018
© 2012 - 2018 Kids Code Jeunesse | All Right Reserved