Erster Entwurf Upgrade menu (Mit Folke zusammen)
This commit is contained in:
Binary file not shown.
BIN
Game/__pycache__/upgrades_test.cpython-313.pyc
Normal file
BIN
Game/__pycache__/upgrades_test.cpython-313.pyc
Normal file
Binary file not shown.
14
Game/game.py
14
Game/game.py
@@ -4,17 +4,17 @@ import random
|
||||
propability = 40
|
||||
coins_per_head = 0.5
|
||||
coins = 5
|
||||
coins_amount = 1
|
||||
heads_amount = 1
|
||||
multiplier = 0.5
|
||||
|
||||
def coin_flip(propability, coins, coins_per_head, coins_amount, multiplier):
|
||||
def coin_flip(propability, coins, coins_per_head, heads_amount, multiplier):
|
||||
while True:
|
||||
result = random.randint(0, 100)
|
||||
if result in range(0,propability):
|
||||
print(f'Kopf ({coins_amount}x)')
|
||||
coins_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
||||
if coins_amount >=3:
|
||||
coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
||||
print(f'Kopf ({heads_amount}x)')
|
||||
heads_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
||||
if heads_amount >=3:
|
||||
heads_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
||||
else:
|
||||
coins_per_head = 0.5
|
||||
coins += coins_per_head
|
||||
@@ -27,5 +27,5 @@ def coin_flip(propability, coins, coins_per_head, coins_amount, multiplier):
|
||||
input()
|
||||
|
||||
|
||||
coin_flip(propability, coins, coins_per_head, coins_amount, multiplier)
|
||||
coin_flip(propability, coins, coins_per_head, heads_amount, multiplier)
|
||||
|
||||
|
||||
@@ -1,16 +1,52 @@
|
||||
from upgrades import coin_multiplier, lucky_coin, flip_chance
|
||||
|
||||
lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||
base_lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||
base_lvl_flip_chance = flip_chance(10, 0)
|
||||
base_lvl_lucky_coin = lucky_coin(0.5, 10)
|
||||
|
||||
def lvl_up_coin_multiplier():
|
||||
def lvl_up_multiplier():
|
||||
lvl_up = True
|
||||
|
||||
if lvl_up == True:
|
||||
lvl_coin_multiplier.cost *= 2.5
|
||||
lvl_coin_multiplier.multiplier *= 5
|
||||
base_lvl_coin_multiplier.cost *= 2.5
|
||||
base_lvl_coin_multiplier.multiplier *= 5
|
||||
print(f' CM: {base_lvl_coin_multiplier.cost}')
|
||||
print(f' MM: {base_lvl_coin_multiplier.multiplier}')
|
||||
|
||||
print(lvl_coin_multiplier.cost)
|
||||
def lvl_up_flip_chance():
|
||||
lvl_up = True
|
||||
|
||||
lvl_up_coin_multiplier()
|
||||
if lvl_up == True:
|
||||
base_lvl_flip_chance.cost += 1
|
||||
base_lvl_flip_chance.cost *= 6
|
||||
base_lvl_flip_chance.chance *= 1.5
|
||||
print(f" FC Cost: {base_lvl_flip_chance.cost}")
|
||||
print(f" FC Chance: {base_lvl_flip_chance.chance}")
|
||||
|
||||
|
||||
def lvl_up_lucky_coin():
|
||||
lvl_up = True
|
||||
|
||||
if lvl_up == True:
|
||||
base_lvl_lucky_coin.cost *= 3
|
||||
base_lvl_lucky_coin.chance *= 1.5
|
||||
print(f" LC Cost: {base_lvl_lucky_coin.cost}")
|
||||
print(f" LC Chance: {base_lvl_lucky_coin.chance}")
|
||||
|
||||
def homepage_upgrades():
|
||||
while True:
|
||||
answer = input(' Flip Chance: [1]\n Lucky Coin: [2]\n Multiplier: [3]')
|
||||
try:
|
||||
answer = int(answer)
|
||||
if answer == 1:
|
||||
lvl_up_flip_chance()
|
||||
break
|
||||
elif answer == 2:
|
||||
lvl_up_lucky_coin()
|
||||
break
|
||||
elif answer == 3:
|
||||
lvl_up_multiplier()
|
||||
break
|
||||
except ValueError:
|
||||
print('Nur Zahlen')
|
||||
|
||||
homepage_upgrades()
|
||||
@@ -33,13 +33,9 @@ def lvl_up_lucky_coin():
|
||||
|
||||
lvl_up_lucky_coin()
|
||||
lvl_up_lucky_coin()
|
||||
|
||||
lvl_up_lucky_coin()
|
||||
|
||||
lvl_up_lucky_coin()
|
||||
|
||||
lvl_up_lucky_coin()
|
||||
|
||||
lvl_up_lucky_coin()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user