-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
31 lines (31 loc) · 808 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
radio.onReceivedNumber(function (receivedNumber) {
Patate = receivedNumber
})
input.onButtonPressed(Button.AB, function () {
Patate = randint(10, 30)
})
input.onGesture(Gesture.Shake, function () {
if (Patate > 0) {
radio.sendNumber(Patate)
Patate = -1
}
})
let Patate = 0
radio.setGroup(5)
Patate = -1
basic.forever(function () {
if (Patate == 0) {
basic.showIcon(IconNames.Ghost)
for (let index = 0; index < 4; index++) {
music.startMelody(music.builtInMelody(Melodies.Funeral), MelodyOptions.Once)
basic.pause(1000)
}
Patate = -1
} else if (Patate < 0) {
basic.clearScreen()
} else if (Patate > 0) {
basic.showIcon(IconNames.Diamond)
Patate += -1
basic.pause(500)
}
})