feat(ects): add some helper functions for etcs
This commit is contained in:
@@ -2,6 +2,7 @@ import pygame
|
|||||||
|
|
||||||
from src.settings import START_ECTS_VALUE, ECTS_UPDATE_INTERVAL
|
from src.settings import START_ECTS_VALUE, ECTS_UPDATE_INTERVAL
|
||||||
|
|
||||||
|
|
||||||
class ECTS:
|
class ECTS:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# total amount of ECTS the player has at the beginning
|
# total amount of ECTS the player has at the beginning
|
||||||
@@ -24,3 +25,9 @@ class ECTS:
|
|||||||
# beer increases amount of how much ECTS are earned per second
|
# beer increases amount of how much ECTS are earned per second
|
||||||
def upgrade_rate(self, extra_ects):
|
def upgrade_rate(self, extra_ects):
|
||||||
self.ects_per_second += extra_ects
|
self.ects_per_second += extra_ects
|
||||||
|
|
||||||
|
def is_over_balance(self, amount):
|
||||||
|
return self.ects_balance >= amount
|
||||||
|
|
||||||
|
def decrease_balance(self, amount):
|
||||||
|
self.ects_balance -= amount
|
||||||
|
|||||||
Reference in New Issue
Block a user