From 07c5afb9905d5e19dd686cf78bcfb7a405da5937 Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 29 Aug 2023 21:24:30 +0100 Subject: [PATCH] add teleporter entity type --- .../the-dungeon-puzzlers-lament/src/game/simulation/entity.rs | 2 ++ examples/the-dungeon-puzzlers-lament/src/level.rs | 4 ++++ examples/the-dungeon-puzzlers-lament/src/resources.rs | 1 + 3 files changed, 7 insertions(+) diff --git a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs index e264efd4..04851cef 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs @@ -568,6 +568,7 @@ pub enum EntityType { Spikes(Switchable), Ice, MovableBlock, + Teleporter, } #[derive(Debug)] @@ -844,6 +845,7 @@ impl From for EntityType { level::Item::Ice => EntityType::Ice, level::Item::MovableBlock => EntityType::MovableBlock, level::Item::Glove => EntityType::Item(Item::Glove), + level::Item::Teleporter => EntityType::Teleporter, } } } diff --git a/examples/the-dungeon-puzzlers-lament/src/level.rs b/examples/the-dungeon-puzzlers-lament/src/level.rs index 4ddff314..50974ee3 100644 --- a/examples/the-dungeon-puzzlers-lament/src/level.rs +++ b/examples/the-dungeon-puzzlers-lament/src/level.rs @@ -21,6 +21,7 @@ pub enum Item { Ice, MovableBlock, Glove, + Teleporter, } impl Item { @@ -43,6 +44,7 @@ impl Item { Item::Ice => resources::ICE, Item::MovableBlock => resources::ROCK_SHADOW, Item::Glove => resources::POW_GLOVE_SHADOW, + Item::Teleporter => resources::TELEPORTER, } } @@ -65,6 +67,7 @@ impl Item { Item::Ice => resources::ICE, Item::MovableBlock => resources::ROCK, Item::Glove => resources::POW_GLOVE, + Item::Teleporter => resources::TELEPORTER, } } @@ -90,6 +93,7 @@ impl Item { Item::Ice => ZERO, Item::MovableBlock => ZERO, Item::Glove => STANDARD, + Item::Teleporter => ZERO, } } } diff --git a/examples/the-dungeon-puzzlers-lament/src/resources.rs b/examples/the-dungeon-puzzlers-lament/src/resources.rs index ae22aff9..c5d0e645 100644 --- a/examples/the-dungeon-puzzlers-lament/src/resources.rs +++ b/examples/the-dungeon-puzzlers-lament/src/resources.rs @@ -54,6 +54,7 @@ named_tag!( ROCK_SHADOW, POW_GLOVE, POW_GLOVE_SHADOW, + TELEPORTER, ] );