我对Python很陌生。我正在尝试构建一款闲置点击游戏。如果你点击你会得到一个硬币。您应该能够购买“自动点击器”,这意味着您每秒自动获得硬币。我目前的代码处于 while 循环中,当我写“EXIT”时该循环结束。我不知道如何在发生其他事情时实现时间并添加汽车硬币。总而言之:想要实现每秒硬币数
我的代码:
print("Welcome to the game")
coins = 1
a = 0
shop = 0
coinsperclick = 1
nothing = 999
coinspersec = 1
def help():
print("'help' für Hilfe", '\n', "Enter für coins", '\n', "'shop' für den Shop")
help()
a = input()
while a != "EXIT":
a = input()
if a == "shop":
print("Number 0: EXIT Shop Cost: 0")
print("Number 1: Clicker +1 Cost: 50")
print("Number 2: CPS +1 Cost: 100")
shop = eval(input("What do you want to buy?"))
if shop == 0:
nothing = nothing
if shop == 1:
kaufmenge = eval(input("How many do you want to buy?"))
coinsperclick = coinsperclick+kaufmenge
coins = coins-(kaufmenge*50)
if shop == 2:
kaufmenge = eval(input("How many do you want do buy?"))
coinspersec = coinspersec+kaufmenge
coins = coins-(kaufmenge*100)
if a == "help":
help()
if a == "":
coins = coins+coinsperclick
print(coins)
a = 1
慕尼黑5688855
HUWWW
相关分类