Working on collisions
This commit is contained in:
@@ -234,6 +234,10 @@ impl Drawable for PositionedTile {
|
||||
fn position(&self) -> Vector2<f32> {
|
||||
self.position.into()
|
||||
}
|
||||
|
||||
fn origin(&self) -> Vector2<f32> {
|
||||
Vector2::new(0.0, 0.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// The map represents the tiles contained in a level.
|
||||
@@ -363,8 +367,8 @@ impl Map {
|
||||
// Find tile on x, y
|
||||
if x > 0.0 && y > 0.0 {
|
||||
|
||||
let row = (y / 16.0) as usize + 2;
|
||||
let col = (x / 16.0) as usize + 1;
|
||||
let row = (y / 16.0) as usize;
|
||||
let col = (x / 16.0) as usize;
|
||||
|
||||
if let Some((tile, _)) = self.tiles.get((row, col)) {
|
||||
if tile.from_top {
|
||||
|
||||
Reference in New Issue
Block a user