From ced37025a37051db896443d310f5f613f1281882 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Wed, 10 Jul 2019 09:43:48 -0500 Subject: animation now always works, added player spawn --- src/state.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index db72d10..98ad422 100644 --- a/src/state.rs +++ b/src/state.rs @@ -26,13 +26,16 @@ impl State { let tileset = Tileset::new(filesystem::open(context, "/tileset.tsx")?); let map = Map::new(filesystem::open(context, "/map.tmx")?, &tileset); - let map_dimensions = map.get_dimensions(); Ok(State { map: map.clone(), spritebatch: SpriteBatch::new(image), - camera: Camera::new(context, map_dimensions), - player: Player::new(&tileset, map_dimensions), + camera: Camera::new(context, map.get_dimensions()), + player: Player::new( + &tileset, + map.get_spawn_points("player")[0], + map.get_dimensions(), + ), npcs: NPC::build_npcs(&tileset, &map), }) } -- cgit v1.2.3