-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ts
53 lines (42 loc) · 1.62 KB
/
test.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
basic.forever(function () {
basic.showIcon(IconNames.Heart)
basic.showString("Hello World!")
})
basic.forever(function () {
if (input.acceleration(Dimension.X) < -800) {
display.rotateTo(display.Direction.LogoToLeft)
} else if (input.acceleration(Dimension.X) > 800) {
display.rotateTo(display.Direction.LogoToRight)
} else if (input.acceleration(Dimension.Y) < -800) {
display.rotateTo(display.Direction.UpsideDown)
} else if (input.acceleration(Dimension.Y) > 800) {
display.rotateTo(display.Direction.Normal)
}
basic.pause(500)
})
// input.onButtonPressed(Button.A, function () {
// display.rotateTo(display.Direction.Normal)
// basic.showIcon(IconNames.Heart)
// basic.showString("Hello World")
// })
// input.onButtonPressed(Button.B, function () {
// display.rotateTo(display.Direction.LogoRight)
// })
// input.onButtonPressed(Button.AB, function () {
// display.rotateTo(display.Direction.UpsideDown)
// basic.showIcon(IconNames.Heart)
// basic.showString("Hello World")
// })
// basic.forever(function () {
// basic.showIcon(IconNames.Heart)
// basic.showString("Hello World")
// if (input.acceleration(Dimension.X) < -800) {
// rotate.rotateTo(rotate.Direction.LogoLeft)
// } else if (input.acceleration(Dimension.X) > 800) {
// rotate.rotateTo(rotate.Direction.LogoRight)
// } else if (input.acceleration(Dimension.Y) < -800) {
// rotate.rotateTo(rotate.Direction.UpsideDown)
// } else if (input.acceleration(Dimension.Y) > 800) {
// rotate.rotateTo(rotate.Direction.Normal)
// }
// })