Compare commits
2 Commits
652f25467f
...
e00b7e19df
| Author | SHA1 | Date | |
|---|---|---|---|
| e00b7e19df | |||
| 3b2644b539 |
Binary file not shown.
BIN
Game/__pycache__/upgrades.cpython-313.pyc
Normal file
BIN
Game/__pycache__/upgrades.cpython-313.pyc
Normal file
Binary file not shown.
49
Game/game.py
49
Game/game.py
@@ -1,32 +1,31 @@
|
|||||||
import menu
|
import menu
|
||||||
import random
|
import random
|
||||||
if menu.b == 2:
|
|
||||||
|
|
||||||
propability = 40
|
propability = 40
|
||||||
coins_per_head = 0.5
|
coins_per_head = 0.5
|
||||||
coins = 5
|
coins = 5
|
||||||
coins_amount = 1
|
coins_amount = 1
|
||||||
multiplier = 0.5
|
multiplier = 0.5
|
||||||
|
|
||||||
def coin_flip(propability, coins, coins_per_head, coins_amount, multiplier):
|
def coin_flip(propability, coins, coins_per_head, coins_amount, multiplier):
|
||||||
while True:
|
while True:
|
||||||
result = random.randint(0, 100)
|
result = random.randint(0, 100)
|
||||||
if result in range(0,propability):
|
if result in range(0,propability):
|
||||||
print(f'Kopf ({coins_amount}x)')
|
print(f'Kopf ({coins_amount}x)')
|
||||||
coins_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
coins_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
||||||
if coins_amount >=3:
|
if coins_amount >=3:
|
||||||
coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
||||||
else:
|
else:
|
||||||
coins_per_head = 0.5
|
coins_per_head = 0.5
|
||||||
coins += coins_per_head
|
coins += coins_per_head
|
||||||
print('')
|
print('')
|
||||||
print(f'Du hast {coins} Coins (+ {coins_per_head})')
|
print(f'Du hast {coins} Coins (+ {coins_per_head})')
|
||||||
input()
|
input()
|
||||||
elif result in range(propability,100):
|
elif result in range(propability,100):
|
||||||
print('Zahl')
|
print('Zahl')
|
||||||
coins_amount = 1
|
coins_amount = 1
|
||||||
input()
|
input()
|
||||||
|
|
||||||
|
|
||||||
coin_flip(propability, coins, coins_per_head, coins_amount, multiplier)
|
coin_flip(propability, coins, coins_per_head, coins_amount, multiplier)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
import upgrades
|
from upgrades import coin_multiplier, lucky_coin, flip_chance
|
||||||
|
|
||||||
def homepage():
|
lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||||
available_upgrades = []
|
|
||||||
|
def lvl_up_coin_multiplier():
|
||||||
|
lvl_up = True
|
||||||
|
|
||||||
|
if lvl_up == True:
|
||||||
|
lvl_coin_multiplier.cost *= 2.5
|
||||||
|
lvl_coin_multiplier.multiplier *= 5
|
||||||
|
|
||||||
|
print(lvl_coin_multiplier.cost)
|
||||||
|
|
||||||
|
lvl_up_coin_multiplier()
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +1,35 @@
|
|||||||
class coin_multiplier(): #Klasse, die das Upgrade darstellt, welches die anzahl des Bonusses beim Kopfwurf veraendert
|
class coin_multiplier(): #Klasse, die das Upgrade darstellt, welches die anzahl des Bonusses beim Kopfwurf veraendert
|
||||||
def __init__(self, multiplier:float, cost:int):
|
def __init__(self, multiplier:float, cost:int):
|
||||||
multiplier = self.multiplier
|
self.multiplier = multiplier
|
||||||
cost = self.cost
|
self.cost = cost
|
||||||
|
|
||||||
class flip_chance(): #Upgrade, welches die Chance auf kopf veraendert
|
class flip_chance(): #Upgrade, welches die Chance auf kopf veraendert
|
||||||
def __init__(self, chance: int, cost: int):
|
def __init__(self, chance:int, cost:int):
|
||||||
chance = self.chance
|
self.chance = chance
|
||||||
cost = self.cost
|
self.cost = cost
|
||||||
|
|
||||||
class lucky_coin(): #Upgrade, welches festlegt wie hoch die Wahrscheinlichkeit auf einen LuckyCoin (Jackpot) ist
|
class lucky_coin(): #Upgrade, welches festlegt wie hoch die Wahrscheinlichkeit auf einen LuckyCoin (Jackpot) ist
|
||||||
def __init__(self, chance:float, cost:int):
|
def __init__(self, chance:float, cost:int):
|
||||||
chance = self.lucky_chance
|
self.chance = chance
|
||||||
cost = self.cost
|
self.cost = cost
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
base_lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||||
|
|
||||||
|
def lvl_up():
|
||||||
|
lvl_up = True
|
||||||
|
|
||||||
|
if lvl_up == True:
|
||||||
|
base_lvl_coin_multiplier.cost *= 2.5
|
||||||
|
base_lvl_coin_multiplier.multiplier *= 5
|
||||||
|
print(base_lvl_coin_multiplier.cost)
|
||||||
|
|
||||||
|
lvl_up()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Alle Upgrades inklusive Werten und kosten von Level 1 bis 10
|
#Alle Upgrades inklusive Werten und kosten von Level 1 bis 10
|
||||||
coin_multiplier_lvl1 = coin_multiplier(0.5,0)
|
coin_multiplier_lvl1 = coin_multiplier(0.5,0)
|
||||||
@@ -27,15 +45,15 @@ coin_multiplier_lvl10 = coin_multiplier(100,10000)
|
|||||||
|
|
||||||
|
|
||||||
flip_chance_lvl1 = flip_chance(5,0)
|
flip_chance_lvl1 = flip_chance(5,0)
|
||||||
flip_chance_lvl2 = flip_chance(10,5)
|
flip_chance_lvl2 = flip_chance(10,500)
|
||||||
flip_chance_lvl3 = flip_chance(18,20)
|
flip_chance_lvl3 = flip_chance(18,1500)
|
||||||
flip_chance_lvl4 = flip_chance(25,40)
|
flip_chance_lvl4 = flip_chance(25,4000)
|
||||||
flip_chance_lvl5 = flip_chance(35,50)
|
flip_chance_lvl5 = flip_chance(35,10000)
|
||||||
flip_chance_lvl6 = flip_chance(50,150)
|
flip_chance_lvl6 = flip_chance(50,20000)
|
||||||
flip_chance_lvl7 = flip_chance(60,300)
|
flip_chance_lvl7 = flip_chance(60,20000)
|
||||||
flip_chance_lvl8 = flip_chance(75,1000)
|
flip_chance_lvl8 = flip_chance(75,25000)
|
||||||
flip_chance_lvl9 = flip_chance(80,4000)
|
flip_chance_lvl9 = flip_chance(80,50000)
|
||||||
flip_chance_lvl10 = flip_chance(95,10000)
|
flip_chance_lvl10 = flip_chance(95,100000)
|
||||||
|
|
||||||
|
|
||||||
lucky_coin_lvl1 = lucky_coin(0.1, 0)
|
lucky_coin_lvl1 = lucky_coin(0.1, 0)
|
||||||
|
|||||||
12
Game/upgrades_test.py
Normal file
12
Game/upgrades_test.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from upgrades import coin_multiplier
|
||||||
|
|
||||||
|
base_lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||||
|
|
||||||
|
def lvl_up_multiplier():
|
||||||
|
lvl_up = True
|
||||||
|
|
||||||
|
if lvl_up == True:
|
||||||
|
base_lvl_coin_multiplier.cost *= 2.5
|
||||||
|
base_lvl_coin_multiplier.multiplier *= 5
|
||||||
|
print(base_lvl_coin_multiplier.cost)
|
||||||
|
|
||||||
Reference in New Issue
Block a user