diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-06-27 18:07:28 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-06-27 18:07:28 +0200 |
commit | 0e3548c13634e078b71c022ac49a3cea7e0c420d (patch) | |
tree | b4959173d6b1ec95af94d8efa2a7949b7b6d6417 /src/constants.rs | |
parent | b7e5273627c1b6db9faf8e29e2445bdbba802453 (diff) |
Implemented bomb attacks
Diffstat (limited to 'src/constants.rs')
-rw-r--r-- | src/constants.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/constants.rs b/src/constants.rs index dcda1d5..fd1263a 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,3 +1,5 @@ +use crate::geometry::Vec2d; + pub const MAP_SIZE: usize = 33; pub const MAP_ROW_SIZE: [MapRow; MAP_SIZE] = [ MapRow { start_bit: 0, x_offset: 11 }, @@ -46,4 +48,26 @@ impl MapRow { pub fn len(&self) -> usize { MAP_SIZE - 2 * self.x_offset } + + pub fn is_empty(&self) -> bool { + self.len() == 0 + } } + + +pub const BOMB_DAMAGED_SPACES: usize = 13; +pub const BOMB_DAMAGES: [(Vec2d<i8>, i32); BOMB_DAMAGED_SPACES] = [ + (Vec2d::new(0, -2), 7), + (Vec2d::new(2, 0), 7), + (Vec2d::new(0, 2), 7), + (Vec2d::new(-2, 0), 7), + (Vec2d::new(1, -1), 11), + (Vec2d::new(1, 1), 11), + (Vec2d::new(-1, 1), 11), + (Vec2d::new(-1, -1), 11), + (Vec2d::new(0, -1), 13), + (Vec2d::new(0, -1), 13), + (Vec2d::new(0, -1), 13), + (Vec2d::new(0, -1), 13), + (Vec2d::new(0, 0), 20) +]; |