about summary refs log tree commit diff
path: root/src/game.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-07-14T18·29-0400
committerGriffin Smith <root@gws.fyi>2019-07-14T18·29-0400
commite7ad87c7301f266dece36e7558c0f212e370aac6 (patch)
tree7da150d5648cc0b17d973bf4a30673f36b20be82 /src/game.rs
parent081146da30bcf1a17d9533c3dc9c735a3a558165 (diff)
Add (statically-included) entity raws
Add a system for statically-included entity raws (which necessitated
making a deserializable existential Color struct) and test it out by
initializing the game (for now) with a single on-screen gormlak.
Diffstat (limited to 'src/game.rs')
-rw-r--r--src/game.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/game.rs b/src/game.rs
index 1a43628b4318..f86d32d0463c 100644
--- a/src/game.rs
+++ b/src/game.rs
@@ -1,11 +1,12 @@
 use crate::display::{self, Viewport};
 use crate::entities::Character;
-use crate::entities::Entity;
+use crate::entities::{Creature, Entity};
 use crate::messages::message;
 use crate::settings::Settings;
 use crate::types::command::Command;
 use crate::types::entity_map::EntityID;
 use crate::types::entity_map::EntityMap;
+use crate::types::pos;
 use crate::types::Ticks;
 use crate::types::{
     BoundingBox, Collision, Dimensions, Position, Positioned, PositionedMut,
@@ -74,6 +75,15 @@ impl<'a> Game<'a> {
             None => SmallRng::from_entropy(),
         };
         let mut entities: EntityMap<AnEntity<'a>> = EntityMap::new();
+
+        // TODO make this dynamic
+        {
+            entities.insert(Box::new(Creature::new_from_raw(
+                "gormlak",
+                pos(10, 0),
+            )));
+        }
+
         Game {
             settings,
             rng,