From 636e9d04e25994b9caec5fb108c3a5e6bea076e7 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Fri, 4 Oct 2024 22:35:15 +0200 Subject: [PATCH] cleanup --- assets/tiles/down.png | Bin 198 -> 198 bytes assets/tiles/left.png | Bin 211 -> 203 bytes assets/tiles/mirror_back.png | Bin 204 -> 207 bytes assets/tiles/mirror_forward.png | Bin 205 -> 211 bytes assets/tiles/right.png | Bin 220 -> 224 bytes assets/tiles/up.png | Bin 205 -> 205 bytes src/main.rs | 5 +++-- src/marble_engine.rs | 4 ++-- src/marble_engine/board.rs | 4 ++-- src/marble_engine/tile.rs | 32 +++----------------------------- 10 files changed, 10 insertions(+), 35 deletions(-) diff --git a/assets/tiles/down.png b/assets/tiles/down.png index 9f40dea9889641b23b6ec110f36bd675e6f6ecd4..34d8dba0274fbe2b0d4ababa956ed0a42cc0d713 100644 GIT binary patch delta 163 zcmV;U09^mZ0mcE4D}Q5ry!9CaDS(B6f#KJ=KWs)U#S07YsOycN08z%oz`#IIH3I`f z@xlT&BNhe*2FAx*pFvc&>-ON$P}4YOvnb{Qq8uH8?Jx}ztb@R zLIYMy(2S?d224vZji=ZKWJ|CbPp%EU@e?pD!89JCjPdc-XB;FYK1NcLHvsyVOOLhy ReZBwy002ovPDHLkV1gg8MTh_Z delta 163 zcmV;U09^mZ0mcE4D}SYuF$#b%3`KuSDTudmbrS~>k88z2++4jxp*Ijg92^2FMl029 zg_rj_L|EexG77*lt~yc8PJc$0tJ1djnbSQ0L<@ RkaGY4002ovPDHLkV1k`lMX&$> diff --git a/assets/tiles/left.png b/assets/tiles/left.png index 5bb4a87418bbf829a4a40a108547f040242bf0ac..d901c9156d451b614a8700f5775bd321b631ad58 100644 GIT binary patch delta 175 zcmV;g08sza0m}i9B!7}gL_t(2kz;(k^%(;xfQ5m9;n%r8Y(^}_3k&e5>y4iPQO3l; zz<^(MyKWBy14Hq`0yZNS1_lPk$6KG_QVmfG0hO0aAoj2jRQk*5E89M96hGiniWML<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offset: Vector2, zoom: i32, - ){ + ) { let tile_size = 16 << zoom; for x in 0..self.width { for y in 0..self.height { diff --git a/src/marble_engine/tile.rs b/src/marble_engine/tile.rs index aea08e1..1fd4550 100644 --- a/src/marble_engine/tile.rs +++ b/src/marble_engine/tile.rs @@ -92,7 +92,7 @@ impl Tile { x: i32, y: i32, size: i32, - zoom:i32, + zoom: i32, ) { let tex_name = match self { Tile::Blank => "", @@ -145,7 +145,7 @@ impl Tile { texture, Vector2::new((x - size / 2) as f32, (y - size / 2) as f32), 0.0, - (1< (), - Tile::Block => d.draw_rectangle(x - size / 2, y - size / 2, size, size, Color::DIMGRAY), Tile::Comment(c) => { d.draw_rectangle(x - size / 2, y - size / 2, size, size, Color::DIMGRAY); d.draw_text(&format!("{}", *c as char), x - 10, y - 10, 20, Color::WHITE); } - Tile::Marble { value, dir } => { - d.draw_circle(x, y, size as f32 * 0.35, Color::new(15, 15, 15, 255)); - d.draw_text( - &format!("{value}"), - x - size / 2 + 2, - y - size / 2 + 2, - 20, - Color::MAGENTA, - ); - } Tile::Digit(n) => { d.draw_text(&String::from(*n as char), x - 10, y - 10, 20, Color::ORANGE) } - Tile::Mirror(mirror) => { - let height = size as f32 * 1.25; - let width = (size / 4) as f32; - let rec = Rectangle { - x: x as f32, - y: y as f32, - width, - height, - }; - let rot = match mirror { - MirrorType::Forward => 45.0, - MirrorType::Back => -45.0, - }; - d.draw_rectangle_pro(rec, Vector2::new(width, height) * 0.5, rot, Color::CYAN); - } - _ => d.draw_rectangle(x - size / 2, y - size / 2, size, size, Color::YELLOW), + _ => d.draw_rectangle(x - size / 2, y - size / 2, size, size, Color::RED), } } }