mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-14 14:12:26 -06:00
feat: smooth back-forth sprite frame ticks, sprite rotation
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user