-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
58 lines (55 loc) · 1.37 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// On start do a reset
let maxSecondCount = 60
let reset = 1
let secondCounter = maxSecondCount
input.onGesture(Gesture.Shake, function on_gesture_shake() {
reset = 1
secondCounter = maxSecondCount
images.iconImage(IconNames.Yes).showImage(0)
basic.pause(200)
images.createImage(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`).showImage(0)
basic.pause(200)
images.iconImage(IconNames.Yes).showImage(0)
basic.pause(200)
images.createImage(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`).showImage(0)
basic.pause(200)
reset = 0
})
basic.forever(function on_forever() {
if (!(secondCounter == 0) && reset == 0) {
basic.showString("" + ("" + secondCounter))
basic.pause(1000)
secondCounter += -1
} else {
while (secondCounter == 0) {
images.createImage(`
. # # . .
# . . # .
# . . # .
# . . # .
. # # . .
`).showImage(0)
basic.pause(200)
images.createImage(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`).showImage(0)
basic.pause(200)
}
}
})