mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 08:07:56 -06:00
feat: implement collision detection system for entities
This commit is contained in:
@@ -4,10 +4,13 @@
|
||||
//! animation, and rendering. Pac-Man moves through the game graph using
|
||||
//! a traverser and displays directional animated textures.
|
||||
|
||||
use crate::entity::direction::Direction;
|
||||
use crate::entity::graph::{Edge, EdgePermissions, Graph, NodeId};
|
||||
use crate::entity::r#trait::Entity;
|
||||
use crate::entity::traversal::Traverser;
|
||||
use crate::entity::{
|
||||
collision::Collidable,
|
||||
direction::Direction,
|
||||
graph::{Edge, EdgePermissions, Graph, NodeId},
|
||||
r#trait::Entity,
|
||||
traversal::Traverser,
|
||||
};
|
||||
use crate::texture::animated::AnimatedTexture;
|
||||
use crate::texture::directional::DirectionalAnimatedTexture;
|
||||
use crate::texture::sprite::SpriteAtlas;
|
||||
@@ -125,3 +128,9 @@ impl Pacman {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Collidable for Pacman {
|
||||
fn position(&self) -> crate::entity::traversal::Position {
|
||||
self.traverser.position
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user