【发布时间】:2016-01-25 00:57:46
【问题描述】:
while not done:
baddieAddCounter = 0
baddies = []
score += 1
fact = ""
#GIVES PLAYER A NEW FACT EVERYTIME THEY REACH THE TARGET SCORE
if score < 200:
fact == 'NOTHING'
elif score > 200 and score <= 599:
fact == 'SWAG'
elif score > 600 and score <= 799:
fact == 'brehh'
drawText('Score: %s' % (score), font, screen, 10, 0)
drawText('Fact: %s' % (fact), font, screen, 10, 40)
pygame.display.update()
为什么这不起作用?在游戏中,一旦玩家得分达到目标得分(例如 >200),它应该将事实(例如 SWAG')更改为“if”语句中所说的内容,但由于“事实 =”而保持不变"'。
【问题讨论】:
-
应该是
fact = 'NOTHING'而不是fact == 'NOTHING'等
标签: python python-2.7 pygame