From baa4b9d910c196f943b0cd162a38ee7865a6be6e Mon Sep 17 00:00:00 2001 From: mitchellhansen Date: Thu, 9 Jan 2020 23:57:37 -0800 Subject: [PATCH] fixed small gaps in scrolling --- src/main.rs | 2 +- src/state.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1be0baf..3d4a234 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ use std::str::FromStr; fn main() -> amethyst::Result<()> { - amethyst::start_logger(Default::default()); + // amethyst::start_logger(Default::default()); // Gets the root directory of the application let mut app_root = PathBuf::from_str("/home/mrh/source/flappy-bird-rust/")?; diff --git a/src/state.rs b/src/state.rs index e365598..7f0ae81 100644 --- a/src/state.rs +++ b/src/state.rs @@ -132,7 +132,7 @@ impl SplashState { let mut transform = Transform::default(); transform.set_scale(Vector3::new(3.0, 3.0, 3.0)); - transform.set_translation_xyz(3.0*144.0/2.0, 3.0*256.0/2.0, 0.0); + transform.set_translation_xyz(3.0*143.0/2.0, 3.0*256.0/2.0, 0.0); self.persistent_sprites.push(world .create_entity() @@ -140,13 +140,13 @@ impl SplashState { .with(TiledScroller { speed: -75.0, position: 1.0, - width: 144.0 * 3.0, + width: 143.0 * 3.0, height: 256.0 * 3.0, }) .with(transform.clone()) .build()); - transform.set_translation_xyz(3.0*144.0/2.0*3.0, 3.0*256.0/2.0, 0.0); + transform.set_translation_xyz(3.0*143.0/2.0*3.0, 3.0*256.0/2.0, 0.0); self.persistent_sprites.push(world .create_entity() @@ -154,7 +154,7 @@ impl SplashState { .with(TiledScroller { speed: -75.0, position: 2.0, - width: 144.0 * 3.0, + width: 143.0 * 3.0, height: 256.0 * 3.0, }) .with(transform.clone()) @@ -168,7 +168,7 @@ impl SplashState { .with(TiledScroller { speed: -100.0, position: 2.0, - width: 168.0 * 3.0, + width: 167.0 * 3.0, height: 56.0 * 3.0, }) .with(transform.clone()) @@ -182,7 +182,7 @@ impl SplashState { .with(TiledScroller { speed: -100.0, position: 2.0, - width: 168.0 * 3.0, + width: 167.0 * 3.0, height: 56.0 * 3.0, }) .with(transform.clone())