From 2d0f2d8ce0dffcacb34aa6ce1388d1b46e1005ad Mon Sep 17 00:00:00 2001 From: Raymond Hogenson Date: Mon, 20 Aug 2018 09:10:49 -0400 Subject: Move assets directly into the binary Wow rust has a built-in operation for moving binary assets into a file! That's so cool! Rust is the best language in the world! Does C++ have this? --- src/state.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/state.rs') 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 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; -- cgit v1.3.1