Random block variants
parent
29950fb0f8
commit
7d5f37367f
|
@ -1,3 +1,5 @@
|
||||||
|
import random
|
||||||
|
|
||||||
from level.Level import Level
|
from level.Level import Level
|
||||||
from level.LevelElementSymbols import LevelElementSymbols
|
from level.LevelElementSymbols import LevelElementSymbols
|
||||||
from level.elements.BlockElement import BlockElement
|
from level.elements.BlockElement import BlockElement
|
||||||
|
@ -25,7 +27,7 @@ class LoadedLevel:
|
||||||
if tile_element in LevelElementSymbols.BLOCKS_LIST:
|
if tile_element in LevelElementSymbols.BLOCKS_LIST:
|
||||||
spritesheet = self.spritesheet_manager.get_sheet(level.theme + tile_element['sprite_id'])
|
spritesheet = self.spritesheet_manager.get_sheet(level.theme + tile_element['sprite_id'])
|
||||||
sprite = BlockElement(spritesheet)
|
sprite = BlockElement(spritesheet)
|
||||||
sprite.set_animation_state('1')
|
sprite.set_animation_state(str(random.randint(0, 3)))
|
||||||
sprite.position_scale.position = position
|
sprite.position_scale.position = position
|
||||||
|
|
||||||
# tile['id'], tile['requirements']
|
# tile['id'], tile['requirements']
|
||||||
|
|
Loading…
Reference in New Issue