fix saut de ligne

This commit is contained in:
CoCo_Sol 2023-05-31 11:10:36 +02:00
parent 0bb19ace02
commit c46281effa

View file

@ -27,9 +27,7 @@ impl Position {
/// Peret de recuper la position, sous form d'un transform, d'un objet sur la carte du jeu. /// Peret de recuper la position, sous form d'un transform, d'un objet sur la carte du jeu.
pub fn to_map_position(&self) -> Transform { pub fn to_map_position(&self) -> Transform {
let offset_x = self.y % 2; let offset_x = self.y % 2;
let new_x = (offset_x as f32).mul_add(0.5, self.x as f32); let new_x = (offset_x as f32).mul_add(0.5, self.x as f32);
Transform::from_xyz(new_x, self.y as f32 * 0.42, self.y as f32 * -1.) Transform::from_xyz(new_x, self.y as f32 * 0.42, self.y as f32 * -1.)
} }
} }