From 01084d69df3ac251694a0d328d556ac38a3f4bb2 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Mon, 20 Jul 2020 21:06:12 +0100 Subject: [PATCH] invert tiles --- src/tile.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tile.rs b/src/tile.rs index 0f49ab1..a3b9873 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -43,6 +43,14 @@ impl Tile { // todo refactor + pub fn invert(&mut self) { + self.animation_frames = self.animation_frames.iter().map(|frame: &Image| { + let mut image = frame.clone(); + image.invert(); + image + }).collect() + } + pub fn flip(&mut self) { self.animation_frames = self.animation_frames.iter().map(|frame: &Image| { let mut image = frame.clone();