Test der lvl up mechanic (Folke und ich zusammen)
This commit is contained in:
BIN
Game/__pycache__/upgrades.cpython-313.pyc
Normal file
BIN
Game/__pycache__/upgrades.cpython-313.pyc
Normal file
Binary file not shown.
@@ -1,5 +1,16 @@
|
|||||||
import upgrades
|
from upgrades import coin_multiplier, lucky_coin, flip_chance
|
||||||
|
|
||||||
|
lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
def homepage():
|
|
||||||
available_upgrades = []
|
|
||||||
|
|
||||||
@@ -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)
|
||||||
|
|||||||
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