diff options
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/src/render.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/graphics/src/render.rs b/graphics/src/render.rs index 1bb32ee..8bde77d 100644 --- a/graphics/src/render.rs +++ b/graphics/src/render.rs @@ -2,7 +2,7 @@ //! the game, with each frame represented by a `Renderer` and //! frame specific information in `FrameInfo`. -use dungeon::{Dungeon, Entity}; +use dungeon::{Dungeon, Entity, Player}; use raylib::{ color::Color, prelude::{RaylibDraw, RaylibDrawHandle, RaylibHandle}, @@ -81,8 +81,14 @@ impl<'a> Renderer<'a> { // Draw the dungeon self.draw_tiles(dungeon); - self.draw_player(dungeon); + self.draw_player(&dungeon.player); + // Draw the ui + self.draw_ui(dungeon); + } + + /// Draws player HP, inventory, and floor number + pub fn draw_ui(&mut self, _dungeon: &Dungeon) { #[cfg(feature = "debug")] // Draw fps (debug only) self.draw_fps(); @@ -94,8 +100,8 @@ impl<'a> Renderer<'a> { } /// Draw the player sprite - pub fn draw_player(&mut self, dungeon: &Dungeon) { - self.draw_entity(dungeon.player()); + pub fn draw_player(&mut self, player: &Player) { + self.draw_entity(&player.entity); } /// Draws an entity |