diff options
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/state.rs b/src/state.rs index d80c550..820c1e4 100644 --- a/src/state.rs +++ b/src/state.rs @@ -57,7 +57,8 @@ impl<T: StraightBullet> Bullet for T { self.set_real_y(real_y + d_y); } fn delete(&mut self) { - self.set_real_x(-10.); + /* TODO: maybe a more robust way of deleting */ + self.set_real_x(-1000.); } } @@ -120,7 +121,7 @@ pub trait Positioned { fn outside(&self) -> bool { let x = self.x(); let y = self.y(); - x < 0 || x > constants::X_DIM as i32 || y < 0 || y > constants::Y_DIM as i32 + x < -100 || x > constants::X_DIM as i32 + 100 || y < -100 || y > constants::Y_DIM as i32 + 100 } } @@ -136,7 +137,7 @@ impl Positioned for PBullet { } } -pub trait Drawable : Positioned { +pub trait Drawable: Positioned { fn center() -> (u32, u32); fn draw(&self, canvas: &mut sdl2::render::WindowCanvas, texture: &sdl2::render::Texture) { let tw = texture.query().width; |
