From 6589e5e3df63d5abf85313c4d21097432257f453 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Fri, 5 Jul 2019 02:50:38 -0500 Subject: removed math, operable to map and layers, on the way to merging tile and frame --- src/animations.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/animations.rs') 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) +} -- cgit v1.2.3