Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Render(sprite=Sprite.ladder, color='wood'),
name='ladder',
)
CaveWall = Architecture(
Solid,
Render(sprite=Sprite.halftone, color='rock'),
name='wall',
)
Wall = Architecture(
Solid,
Render(sprite=Sprite.fill, color='wall'),
name='wall',
)
Pillar = Architecture(
Solid,
Render(sprite=Sprite.pillar, color='rock'),
name='pillar',
)
KadathGate = Architecture(
Solid,
Render(sprite=Sprite.gate, color='gate'),
name='wall',
)
Water = Architecture(
Solid,
Render(sprite=Sprite.water, color='water'),
name='water',
)
Bridge = Architecture(
Empty,
Render(sprite=Sprite.bridge, color='bridge'),
name='bridge',
Breakable(health=10),
HealthRender(
(2, Sprite.rubble4, 'decay2'),
(2, Sprite.rubble3, 'decay2'),
(2, Sprite.rubble2, 'decay2'),
(2, Sprite.rubble1, 'decay3'),
),
name='rubble',
)
Ruin = Architecture(
Solid,
Breakable(health=10),
HealthRender(
(1, Sprite.ruin4a, 'decay3'),
(1, Sprite.ruin4b, 'decay3'),
(1, Sprite.ruin4c, 'decay3'),
(1, Sprite.ruin4d, 'decay3'),
(5, Sprite.ruin3a, 'decay2'),
(5, Sprite.ruin3b, 'decay2'),
(3, Sprite.ruin2, 'decay1'),
(10, Sprite.ruin1e, 'decay0'),
),
name='ruin',
)
# -----------------------------------------------------------------------------
# Creatures
Creature = partial(EntityType, Solid, Container, Bodied, layer=Layer.creature)
Player = Creature(
name='freshly-cut grass',
)
Dirt = Architecture(
Empty,
Render(sprite=Sprite.speckle, color='dirt'),
name='dirt',
)
CaveFloor = Architecture(
Empty,
Render(sprite=Sprite.floor, color='dirt'),
name='cave floor',
)
Door = Architecture(
DoorPhysics,
OpenRender(locked=(Sprite.door_locked, 'dirt'), open=(Sprite.door_open, 'dirt'), closed=(Sprite.door_closed, 'dirt')),
Openable,
Lockable,
name='door',
)
from flax.component import Breakable, HealthRender
Rubble = Architecture(
Empty,
Breakable(health=10),
HealthRender(
(2, Sprite.rubble4, 'decay2'),
(2, Sprite.rubble3, 'decay2'),
(2, Sprite.rubble2, 'decay2'),
(2, Sprite.rubble1, 'decay3'),
),
name='rubble',
Render(sprite=Sprite.halftone, color='rock'),
name='wall',
)
Wall = Architecture(
Solid,
Render(sprite=Sprite.fill, color='wall'),
name='wall',
)
Pillar = Architecture(
Solid,
Render(sprite=Sprite.pillar, color='rock'),
name='pillar',
)
KadathGate = Architecture(
Solid,
Render(sprite=Sprite.gate, color='gate'),
name='wall',
)
Water = Architecture(
Solid,
Render(sprite=Sprite.water, color='water'),
name='water',
)
Bridge = Architecture(
Empty,
Render(sprite=Sprite.bridge, color='bridge'),
name='bridge',
)
Floor = Architecture(
Empty,
Render(sprite=Sprite.floor, color='floor'),
name='dirt',
HealthRender(
(2, Sprite.rubble4, 'decay2'),
(2, Sprite.rubble3, 'decay2'),
(2, Sprite.rubble2, 'decay2'),
(2, Sprite.rubble1, 'decay3'),
),
name='rubble',
)
Ruin = Architecture(
Solid,
Breakable(health=10),
HealthRender(
(1, Sprite.ruin4a, 'decay3'),
(1, Sprite.ruin4b, 'decay3'),
(1, Sprite.ruin4c, 'decay3'),
(1, Sprite.ruin4d, 'decay3'),
(5, Sprite.ruin3a, 'decay2'),
(5, Sprite.ruin3b, 'decay2'),
(3, Sprite.ruin2, 'decay1'),
(10, Sprite.ruin1e, 'decay0'),
),
name='ruin',
)
# -----------------------------------------------------------------------------
# Creatures
Creature = partial(EntityType, Solid, Container, Bodied, layer=Layer.creature)
Player = Creature(
Combatant(strength=3, health=20),
Render(sprite=Sprite.bridge, color='bridge'),
name='bridge',
)
Floor = Architecture(
Empty,
Render(sprite=Sprite.floor, color='floor'),
name='dirt',
)
Tree = Architecture(
Solid,
Render(sprite=Sprite.tree, color='tree'),
name='tree',
)
Grass = Architecture(
Empty,
Render(sprite=Sprite.tall_grass, color='grass'),
name='grass',
)
CutGrass = Architecture(
Empty,
Render(sprite=Sprite.grass, color='grass'),
name='freshly-cut grass',
)
Dirt = Architecture(
Empty,
Render(sprite=Sprite.speckle, color='dirt'),
name='dirt',
)
CaveFloor = Architecture(
Empty,
Render(sprite=Sprite.floor, color='dirt'),
name='cave floor',
Door = Architecture(
DoorPhysics,
OpenRender(locked=(Sprite.door_locked, 'dirt'), open=(Sprite.door_open, 'dirt'), closed=(Sprite.door_closed, 'dirt')),
Openable,
Lockable,
name='door',
)
from flax.component import Breakable, HealthRender
Rubble = Architecture(
Empty,
Breakable(health=10),
HealthRender(
(2, Sprite.rubble4, 'decay2'),
(2, Sprite.rubble3, 'decay2'),
(2, Sprite.rubble2, 'decay2'),
(2, Sprite.rubble1, 'decay3'),
),
name='rubble',
)
Ruin = Architecture(
Solid,
Breakable(health=10),
HealthRender(
(1, Sprite.ruin4a, 'decay3'),
(1, Sprite.ruin4b, 'decay3'),
(1, Sprite.ruin4c, 'decay3'),
(1, Sprite.ruin4d, 'decay3'),
(5, Sprite.ruin3a, 'decay2'),
(5, Sprite.ruin3b, 'decay2'),
Render(sprite=Sprite.tree, color='tree'),
name='tree',
)
Grass = Architecture(
Empty,
Render(sprite=Sprite.tall_grass, color='grass'),
name='grass',
)
CutGrass = Architecture(
Empty,
Render(sprite=Sprite.grass, color='grass'),
name='freshly-cut grass',
)
Dirt = Architecture(
Empty,
Render(sprite=Sprite.speckle, color='dirt'),
name='dirt',
)
CaveFloor = Architecture(
Empty,
Render(sprite=Sprite.floor, color='dirt'),
name='cave floor',
)
Door = Architecture(
DoorPhysics,
OpenRender(locked=(Sprite.door_locked, 'dirt'), open=(Sprite.door_open, 'dirt'), closed=(Sprite.door_closed, 'dirt')),
Openable,
Lockable,
name='door',
)
(2, Sprite.rubble3, 'decay2'),
(2, Sprite.rubble2, 'decay2'),
(2, Sprite.rubble1, 'decay3'),
),
name='rubble',
)
Ruin = Architecture(
Solid,
Breakable(health=10),
HealthRender(
(1, Sprite.ruin4a, 'decay3'),
(1, Sprite.ruin4b, 'decay3'),
(1, Sprite.ruin4c, 'decay3'),
(1, Sprite.ruin4d, 'decay3'),
(5, Sprite.ruin3a, 'decay2'),
(5, Sprite.ruin3b, 'decay2'),
(3, Sprite.ruin2, 'decay1'),
(10, Sprite.ruin1e, 'decay0'),
),
name='ruin',
)
# -----------------------------------------------------------------------------
# Creatures
Creature = partial(EntityType, Solid, Container, Bodied, layer=Layer.creature)
Player = Creature(
Combatant(strength=3, health=20),
PlayerIntelligence,
Render(sprite=Sprite.player, color='player'),