diff options
author | tom barrett <spalf0@gmail.com> | 2019-06-24 09:31:24 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-06-24 09:31:24 -0500 |
commit | 15b4ade5a357a791cf3ffa86cfe78b5f7ae270c9 (patch) | |
tree | c92d8f27280286b4dd83e8f09fe1d99c727f1982 /src/state.rs | |
parent | cccfb66c7c58bf464252e942ef2b742b41ece19e (diff) |
now draws accurately depending on flip
Diffstat (limited to 'src/state.rs')
-rw-r--r-- | src/state.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/state.rs b/src/state.rs index 20066a8..b06d535 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,5 +1,5 @@ use ggez::event::{EventHandler, KeyCode, KeyMods}; -use ggez::graphics::{self, spritebatch::SpriteBatch, DrawParam, FilterMode, Image}; +use ggez::graphics::{self, spritebatch::SpriteBatch, DrawParam, FilterMode, Image, WrapMode}; use ggez::{filesystem, Context, GameResult}; use crate::camera::Camera; @@ -9,7 +9,6 @@ use crate::tileset::Tileset; pub struct State { map: Map, - //tileset: Tileset, spritebatch: SpriteBatch, camera: Camera, player: Player, @@ -19,6 +18,7 @@ impl State { pub fn new(context: &mut Context) -> GameResult<State> { let mut image = Image::new(context, "/tileset.png")?; image.set_filter(FilterMode::Nearest); + image.set_wrap(WrapMode::Mirror, WrapMode::Mirror); let tileset = Tileset::new(filesystem::open(context, "/tileset.tsx")?); @@ -27,7 +27,6 @@ impl State { Ok(State { map, - // tileset, spritebatch: SpriteBatch::new(image), camera: Camera::new(context, map_dimensions), player: Player::new(map_dimensions), |