Added config to increase or decrease game speed when score rising

This commit is contained in:
Anry Das
2025-11-16 09:12:29 +02:00
parent 836f635a6b
commit a04e422547
3 changed files with 20 additions and 8 deletions
+4 -1
View File
@@ -133,6 +133,8 @@ COLORS = {
'game_over': (255, 0, 0)
}
HIGH_SCORE_INC_SPEED = False
def store_config():
blocks_to_save = {'ALL_BLOCKS': BlockType}
@@ -151,7 +153,7 @@ def store_config():
def load_config():
global KEY_CONFIG, COLORS, CONTROLS_TEXT, STORE_WIDTH, BLOCK_SIZE, BLOCK_TYPE
global KEY_CONFIG, COLORS, CONTROLS_TEXT, STORE_WIDTH, BLOCK_SIZE, BLOCK_TYPE, HIGH_SCORE_INC_SPEED
es = EnumSerializer
if not os.path.isfile(CONFIG_JSON) or not os.path.isfile(CONFIG_JSON) :
@@ -164,6 +166,7 @@ def load_config():
COLORS = config_data['CONFIG']['colors']
STORE_WIDTH = config_data['CONFIG']['store_width']
BLOCK_SIZE = config_data['CONFIG']['block_size']
HIGH_SCORE_INC_SPEED = True if str(config_data['CONFIG']['high_score_inc_speed']).lower() == 'true' else False
with open(CONFIG_BLOCKS_JSON) as block_fd:
blocks_data = json.load(block_fd)