Implementierung des Upgrademenus + Nachrichten + Absicherung + Hinzufuegen des Preises (anfang) mit dem lieben Folke
This commit is contained in:
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
import menu
|
||||
#import menu
|
||||
import random
|
||||
|
||||
propability = 40
|
||||
|
||||
@@ -31,12 +31,12 @@ def menu_navigation(a):
|
||||
print('Super!')
|
||||
print('')
|
||||
print('Dann kann es ja losgehen')
|
||||
b = 2
|
||||
input()
|
||||
print('HINWEIS: mit [4] kannst du nach jedem Wurf das Upgrade-Menu aufrufen')
|
||||
input()
|
||||
else:
|
||||
print('Nein? Dann lies nochmal die README.txt und druecke [Enter], wenn du fertig bist')
|
||||
input('')
|
||||
b = 2
|
||||
return b
|
||||
elif a == 2:
|
||||
print('Schade, es gibt jetzt kein Zurueck mehr')
|
||||
input()
|
||||
@@ -44,5 +44,5 @@ def menu_navigation(a):
|
||||
|
||||
title_screen()
|
||||
a = end_game_or_start_question()
|
||||
b = menu_navigation(a)
|
||||
menu_navigation(a)
|
||||
|
||||
|
||||
@@ -1,5 +1,50 @@
|
||||
from upgrades import coin_multiplier, lucky_coin, flip_chance
|
||||
from game import wealth, coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier)
|
||||
#import menu
|
||||
import random
|
||||
|
||||
propability = 40
|
||||
coins_per_head = 0.5
|
||||
wealth = 5000
|
||||
heads_amount = 1
|
||||
multiplier = 0.5
|
||||
|
||||
#Game
|
||||
def coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier):
|
||||
while True:
|
||||
result = random.randint(0, 100)
|
||||
if result in range(0,propability):
|
||||
print(f'Kopf ({heads_amount}x)')
|
||||
heads_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
||||
if heads_amount >=3:
|
||||
coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
||||
else:
|
||||
coins_per_head = 0.5
|
||||
wealth += coins_per_head
|
||||
print('')
|
||||
print(f'Du hast {wealth} Coins (+ {coins_per_head})')
|
||||
answer = input()
|
||||
try:
|
||||
answer = int(answer)
|
||||
if answer == 4:
|
||||
homepage_upgrades(wealth)
|
||||
else:
|
||||
continue
|
||||
except ValueError:
|
||||
continue
|
||||
elif result in range(propability,100):
|
||||
print('Zahl')
|
||||
heads_amount = 1
|
||||
answer = input()
|
||||
try:
|
||||
answer = int(answer)
|
||||
if answer == 4:
|
||||
homepage_upgrades(wealth)
|
||||
else:
|
||||
continue
|
||||
except ValueError:
|
||||
continue
|
||||
|
||||
|
||||
|
||||
|
||||
base_lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||
@@ -36,14 +81,14 @@ def lvl_up_lucky_coin():
|
||||
|
||||
def homepage_upgrades(wealth):
|
||||
while True:
|
||||
answer = input(' Flip Chance: [1]\n Lucky Coin: [2]\n Multiplier: [3]\n Zum Game: [4]')
|
||||
answer = input(f' Flip Chance (Preis: {base_lvl_flip_chance.cost} Coins): [1]\n Lucky Coin: [2]\n Multiplier: [3]\n Zum Game: [4]')
|
||||
try:
|
||||
answer = int(answer)
|
||||
if answer == 1:
|
||||
if wealth >= base_lvl_flip_chance.cost:
|
||||
lvl_up_flip_chance()
|
||||
wealth -= base_lvl_flip_chance.cost
|
||||
print('Erfolgreich geupgradet. Du hast',wealth, "Coins")
|
||||
print(f'Erfolgreich geupgradet. Du hast {wealth} Coins')
|
||||
break
|
||||
else:
|
||||
print('Du bist zu arm')
|
||||
@@ -52,7 +97,7 @@ def homepage_upgrades(wealth):
|
||||
if wealth >= base_lvl_lucky_coin.cost:
|
||||
lvl_up_lucky_coin()
|
||||
wealth -= base_lvl_lucky_coin.cost
|
||||
print('Erfolgreich geupgradet. Du hast',wealth, "Coins")
|
||||
print(f'Erfolgreich geupgradet. Du hast {wealth} Coins')
|
||||
break
|
||||
else:
|
||||
print('Du bist zu arm')
|
||||
@@ -61,7 +106,7 @@ def homepage_upgrades(wealth):
|
||||
if wealth >= base_lvl_coin_multiplier.cost:
|
||||
lvl_up_multiplier()
|
||||
wealth -= base_lvl_coin_multiplier.cost
|
||||
print('Erfolgreich geupgradet. Du hast',wealth, "Coins")
|
||||
print(f'Erfolgreich geupgradet. Du hast {wealth} Coins')
|
||||
break
|
||||
else:
|
||||
print('Du bist zu arm')
|
||||
@@ -76,4 +121,4 @@ def homepage_upgrades(wealth):
|
||||
except ValueError:
|
||||
print('Nur Zahlen')
|
||||
|
||||
homepage_upgrades(wealth)
|
||||
coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier)
|
||||
Reference in New Issue
Block a user