feature: ECTS generation

- add update method to increase ECTS balance over time when player is at desk
This commit is contained in:
Berger Lena
2026-05-07 21:19:55 +02:00
parent 342c086852
commit 7c576806b2
+10
View File
@@ -10,3 +10,13 @@ class ECTS:
self.ects_per_second = START_ECTS_VALUE
# timer when last ECTS was given to player
self.last_update_time = pygame.time.get_ticks()
# check if ECTS should be added
def update(self, is_at_desk):
current_time = pygame.time.get_ticks()
# if player is at desk and interval passed
if is_at_desk and ((current_time - self.last_update_time) >= ECTS_UPDATE_INTERVAL):
self.ects_balance += self.ects_per_second
# reset timer
self.last_update_time = current_time