我正在使用Python制作一个像Cookie游戏的Cookie点击器,我正在尝试让while循环继续运行,以便检查是否已经消失(因此它添加了“cookies”),同时仍然在查看用户是否正在制作输入(点击“Cookie”)。
每当我尝试这个时,它会等待输入而不是循环的其余部分。
这就是我目前的代码(当然还有更多):
While True:
console.clear()
cookieText = "You have " + str(cookies) + " cookies"
print cookieText
clicker = raw_input("")
if clicker == "":
cookies += clickerPower
more...
这是我要添加的内容:
While True:
last = time()
if last == timer:
timer = last
more...