feat: smooth back-forth sprite frame ticks, sprite rotation

This commit is contained in:
2023-09-08 23:38:57 -05:00
parent ffc21c8622
commit 83d665123c
4 changed files with 73 additions and 10 deletions

View File

@@ -1,6 +1,18 @@
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum Direction {
Up,
Down,
Left,
Right,
}
impl Direction {
pub fn angle(&self) -> f64 {
match self {
Direction::Right => 0f64,
Direction::Down => 90f64,
Direction::Left => 180f64,
Direction::Up => 270f64,
}
}
}