summaryrefslogtreecommitdiff
path: root/src/engine/geometry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/geometry.rs')
-rw-r--r--src/engine/geometry.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/engine/geometry.rs b/src/engine/geometry.rs
index f2a2522..a946bf9 100644
--- a/src/engine/geometry.rs
+++ b/src/engine/geometry.rs
@@ -5,6 +5,9 @@ pub struct Point {
}
impl Point {
+ pub fn new(x: u8, y: u8) -> Point {
+ Point { x, y }
+ }
pub fn move_left(&self) -> Option<Point> {
self.x.checked_sub(1).map(|x| Point {
x: x,