Add mouse interaction
This commit is contained in:
@ -18,12 +18,7 @@ pub enum BoatDirection {
|
||||
BottomRight,
|
||||
}
|
||||
|
||||
const _BOATS_DIRECTION: [BoatDirection; 4] = [
|
||||
BoatDirection::Left,
|
||||
BoatDirection::Right,
|
||||
BoatDirection::Up,
|
||||
BoatDirection::Down,
|
||||
];
|
||||
const _BOATS_DIRECTION: [BoatDirection; 2] = [BoatDirection::Right, BoatDirection::Down];
|
||||
|
||||
const _ALL_DIRECTIONS: [BoatDirection; 8] = [
|
||||
BoatDirection::Left,
|
||||
@ -54,8 +49,8 @@ impl BoatDirection {
|
||||
|
||||
pub fn shift_coordinates(&self, coordinates: Coordinates, nth: usize) -> Coordinates {
|
||||
let shift = match self {
|
||||
BoatDirection::Left => (1, 0),
|
||||
BoatDirection::Right => (-1, 0),
|
||||
BoatDirection::Left => (-1, 0),
|
||||
BoatDirection::Right => (1, 0),
|
||||
BoatDirection::Up => (0, -1),
|
||||
BoatDirection::Down => (0, 1),
|
||||
BoatDirection::UpLeft => (-1, -1),
|
||||
|
Reference in New Issue
Block a user