From 7d5f37367f6e5eda3749f750ab75e7dfd1c29b13 Mon Sep 17 00:00:00 2001 From: Yan Wittmann Date: Sun, 26 Mar 2023 17:14:02 +0200 Subject: [PATCH] Random block variants --- project/level/elements/LoadedLevel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project/level/elements/LoadedLevel.py b/project/level/elements/LoadedLevel.py index e42351b..3804ae3 100644 --- a/project/level/elements/LoadedLevel.py +++ b/project/level/elements/LoadedLevel.py @@ -1,3 +1,5 @@ +import random + from level.Level import Level from level.LevelElementSymbols import LevelElementSymbols from level.elements.BlockElement import BlockElement @@ -25,7 +27,7 @@ class LoadedLevel: if tile_element in LevelElementSymbols.BLOCKS_LIST: spritesheet = self.spritesheet_manager.get_sheet(level.theme + tile_element['sprite_id']) sprite = BlockElement(spritesheet) - sprite.set_animation_state('1') + sprite.set_animation_state(str(random.randint(0, 3))) sprite.position_scale.position = position # tile['id'], tile['requirements']