summaryrefslogtreecommitdiff
path: root/src/npc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/npc.rs')
-rw-r--r--src/npc.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/npc.rs b/src/npc.rs
index 48e08b9..9316e69 100644
--- a/src/npc.rs
+++ b/src/npc.rs
@@ -1,9 +1,7 @@
-use ggez::graphics::{spritebatch::SpriteBatch, DrawParam};
-use ggez::nalgebra::{/*distance,*/ Point2, Vector2};
-//use std::time::Instant;
+use ggez::graphics::spritebatch::SpriteBatch;
+use ggez::nalgebra::Point2;
-use crate::animation::Animations;
-use crate::constants;
+use crate::animations::Animations;
use crate::entity::{Entity, Operable};
use crate::map::Map;
use crate::tileset::Tileset;
@@ -17,12 +15,7 @@ pub struct NPC {
impl Operable for NPC {
fn draw(&self, spritebatch: &mut SpriteBatch) {
- spritebatch.add(
- DrawParam::default()
- .src(self.animations.current.current.source)
- .dest(self.entity.position)
- .scale(Vector2::new(constants::TILE_SCALE, constants::TILE_SCALE)),
- );
+ self.animations.draw(spritebatch, self.entity.position);
}
fn update(&mut self) {