无效的语法 python 3.7游戏


#boundary Checking
if goals[count].ycor() > 240 or goals[count].ycor() < -240:
goals[count].right(180)

#collision checking
if isCollision(player, goals[count]):
goals[count].setposition(random.randint(-250, 250), random.randint(-250, 250))
goals[count].right(random.randint(0,360))
score += 1
#Drwa the score on the screen
mypen.undo()
mypen.penup()
mypen.hideturtle()
mypen.setposition(-240, )
scorestring = "Score: %s" %score
mypen.write(scorestring, False, align="left", font=("Arial",14, "normal")
delay = raw_input("press Enter to Finish")

这个问题有点缺乏细节,但马上我已经可以看到一个潜在的问题。Python 2 及更早版本中的raw_input()函数在 Python 3 中重命名为input()

最新更新