From 2ad96b7f882ff962f67a13c7c56a46df86cfe6e3 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Tue, 18 Jun 2019 02:29:24 -0500 Subject: added camera struct, moved map drawing to map struct, now draws a character that moves --- src/camera.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/camera.rs (limited to 'src/camera.rs') diff --git a/src/camera.rs b/src/camera.rs new file mode 100644 index 0000000..1dc2db2 --- /dev/null +++ b/src/camera.rs @@ -0,0 +1,19 @@ +use ggez::nalgebra::Point2; + +pub struct Camera { + pub draw: Point2, +} + +impl Camera { + pub fn new(draw: Point2) -> Camera { + Camera { draw } + } + + pub fn give_center(&mut self, center: Point2) {} +} + +impl Default for Camera { + fn default() -> Camera { + Camera::new(Point2::new(0.0, 0.0)) + } +} -- cgit v1.2.3