diff options
Diffstat (limited to 'src/animations.rs')
-rw-r--r-- | src/animations.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/animations.rs b/src/animations.rs index f1ec902..e308f1d 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -1,6 +1,7 @@ use ggez::graphics::{spritebatch::SpriteBatch, DrawParam, Rect}; use ggez::nalgebra::{Point2, Vector2}; use std::collections::HashMap; +use std::f32::consts::PI; use std::time::Instant; use crate::constants; @@ -143,3 +144,7 @@ pub fn flip(frame: Frame) -> Frame { f.source.x -= frame.source.w; f } + +pub fn convert_angle_to_rad(angle: f32) -> f32 { + angle * (PI / 180.0) +} |