aboutsummaryrefslogtreecommitdiff
path: root/src/world.rs
diff options
context:
space:
mode:
authorGuillaume Pasquet <guillaume.pasquet@eggplant.io>2019-11-13 14:19:45 +0100
committerGuillaume Pasquet <guillaume.pasquet@eggplant.io>2019-11-13 14:19:45 +0100
commit3fb8f5651144ef21338c09c14cd3db03c6416136 (patch)
tree49d6390e20700f922c7ad20b02f24284a13da703 /src/world.rs
parentd6bda2f1662c082b98ac5f05ac9acb5838c1db67 (diff)
Move the player around!
Diffstat (limited to 'src/world.rs')
-rw-r--r--src/world.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/world.rs b/src/world.rs
index 73fc802..c6f0912 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -17,10 +17,10 @@ enum CorridorType {
Vertical,
}
-const LEFT: Movement = (-1, 0);
-const RIGHT: Movement = (1, 0);
-const UP: Movement = (0, -1);
-const DOWN: Movement = (0, 1);
+pub const LEFT: Movement = (-1, 0);
+pub const RIGHT: Movement = (1, 0);
+pub const UP: Movement = (0, -1);
+pub const DOWN: Movement = (0, 1);
pub fn apply_movement(point: Point, movement: Movement) -> Result<Point, String> {
let x = point.0 as i32 + movement.0 as i32;