summaryrefslogtreecommitdiff
path: root/src/animations.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-07-05 02:50:38 -0500
committertom barrett <spalf0@gmail.com>2019-07-05 02:50:38 -0500
commit6589e5e3df63d5abf85313c4d21097432257f453 (patch)
treed53635ead10c9fa9dc951045eff9e31977457f8c /src/animations.rs
parent83ff2ad49e6d3bf83fd85fcfee68a454372bf22a (diff)
removed math, operable to map and layers, on the way to merging tile and frame
Diffstat (limited to 'src/animations.rs')
-rw-r--r--src/animations.rs5
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)
+}