summaryrefslogtreecommitdiff
path: root/src/camera.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-06-18 02:29:24 -0500
committertom barrett <spalf0@gmail.com>2019-06-18 02:29:24 -0500
commit2ad96b7f882ff962f67a13c7c56a46df86cfe6e3 (patch)
tree2bab6cc41f5b0888548dcc3d9a7fa02ef55645b6 /src/camera.rs
parentb4bd866cfadb1eae80f9d116364cab029a28f79b (diff)
added camera struct, moved map drawing to map struct, now draws a character that moves
Diffstat (limited to 'src/camera.rs')
-rw-r--r--src/camera.rs19
1 files changed, 19 insertions, 0 deletions
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<f32>,
+}
+
+impl Camera {
+ pub fn new(draw: Point2<f32>) -> Camera {
+ Camera { draw }
+ }
+
+ pub fn give_center(&mut self, center: Point2<f32>) {}
+}
+
+impl Default for Camera {
+ fn default() -> Camera {
+ Camera::new(Point2::new(0.0, 0.0))
+ }
+}