-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (27 loc) · 808 Bytes
/
main.py
File metadata and controls
29 lines (27 loc) · 808 Bytes
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
def on_button_pressed_a():
global acttime, act
acttime = input.running_time()
act = 1
input.on_button_pressed(Button.A, on_button_pressed_a)
lasttime = 0
count = 0
act = 0
acttime = 0
showtime = 16000
intlimit = 800
cntlimit = 3
def on_forever():
global count, lasttime, act
while input.running_time() - acttime <= intlimit:
if act == 1:
count += 1
lasttime = acttime
act = 0
if count == 1 and input.running_time() - lasttime >= intlimit:
basic.show_arrow(ArrowNames.NORTH)
if count == 2 and input.running_time() - lasttime >= intlimit:
basic.show_arrow(ArrowNames.SOUTH)
if count >= cntlimit or input.running_time() - lasttime >= showtime:
count = 0
basic.clear_screen()
basic.forever(on_forever)