我正在尝试用mu编写游戏类型的东西。但是当我运行该程序时,它会说第48行语法错误,而且放在那里并不重要。
from microbit import *
while True:
if button_a.is_pressed():
i = 1
while True:
display.show(Image.HEART)
sleep(2000)
display.scroll('LOL')
if button_a.is_pressed():
for x in range(0, 10):
display.show(Image.HEART)
newheart = Image("09090:""99999:""99999:""09990:""00900")
display.show(newheart)
sleep(100)
dimheart = Image("06060:""66666:""66666:""06660:""00600")
display.show(dimheart)
sleep(100)
darkheart = Image("03030:""33333:""33333:""03330:""00300")
display.show(darkheart)
sleep(100)
black = Image("00000:""00000:""00000:""00000:""00000")
display.show(black)
sleep(500)
if button_a.is_pressed():
i = 1
while True:
display.show(Image.HEART)
newheart = Image("09090:""99999:""99999:""09990:""00900")
display.show(newheart)
sleep(100)
dimheart = Image("06060:""66666:""66666:""06660:""00600")
display.show(dimheart)
sleep(100)
darkheart = Image("03030:""33333:""33333:""03330:""00300")
display.show(darkheart)
sleep(100)
black = Image("00000:""00000:""00000:""00000:""00000")
display.show(black)
sleep(500)
if accelerometer.was_gesture('shake'):
display.show(Image.HEART)
sleep(500)
brokenheart = Image("09090:""96099:""99069:""09090:""00500")
display.show(brokenheart)
sleep(500)
sdust = Image("09090:""90909:""09090:""90909:""09090"
display.show(sdust)
sleep(500)
dust = Image("00000:""00000:""00600:""07970:""89998")
display.show(dust)
sleep(500)
i = x
whilst True:
display.show(black)
else:
display.scroll('press and hold the A button')
sleep(1000)
谢谢,我只是个初学者
答案 0 :(得分:1)
我认为问题在于这一行
sdust = Image("09090:""90909:""09090:""90909:""09090"
你好像错过了最后的')'