diff --git a/crates/border-wars/assets/tiles/forest.png b/crates/border-wars/assets/tiles/forest.png deleted file mode 100644 index b6c89ec..0000000 Binary files a/crates/border-wars/assets/tiles/forest.png and /dev/null differ diff --git a/crates/border-wars/assets/tiles/grass.png b/crates/border-wars/assets/tiles/grass.png index 6ecf787..1969729 100644 Binary files a/crates/border-wars/assets/tiles/grass.png and b/crates/border-wars/assets/tiles/grass.png differ diff --git a/crates/border-wars/assets/tiles/hill.png b/crates/border-wars/assets/tiles/hill.png deleted file mode 100644 index 1cb6354..0000000 Binary files a/crates/border-wars/assets/tiles/hill.png and /dev/null differ diff --git a/crates/border-wars/src/main.rs b/crates/border-wars/src/main.rs index d0d3a20..ba68cde 100644 --- a/crates/border-wars/src/main.rs +++ b/crates/border-wars/src/main.rs @@ -2,15 +2,14 @@ use bevy::prelude::*; use border_wars::camera::CameraPlugin; -use border_wars::map::generation::{EndMapGeneration, MapGenerationPlugin, StartMapGeneration}; +use border_wars::map::generation::{MapGenerationPlugin, StartMapGeneration}; use border_wars::map::renderer::RendererPlugin; -use border_wars::map::Tile; use border_wars::scenes::ScenesPlugin; fn setup(mut writer: EventWriter) { writer.send(StartMapGeneration { seed: 7128, - radius: 30, + radius: 5, }); } diff --git a/crates/border-wars/src/map/renderer.rs b/crates/border-wars/src/map/renderer.rs index c9d9e25..afdcc4a 100644 --- a/crates/border-wars/src/map/renderer.rs +++ b/crates/border-wars/src/map/renderer.rs @@ -4,9 +4,6 @@ use bevy::prelude::*; use crate::map::{Tile, TilePosition}; -const IMAGE_WIDTH: f32 = 92.; -const OFFSET: f32 = 4.; -const IMAGE_HEIGHT: f32 = 40.; /// A plugin to render the map. pub struct RendererPlugin; @@ -25,8 +22,8 @@ impl Tile { pub fn get_texture(&self, asset_server: &AssetServer) -> Handle { match self { Tile::Grass => asset_server.load("tiles/grass.png"), - Tile::Forest => asset_server.load("tiles/forest.png"), - Tile::Hill => asset_server.load("tiles/hill.png"), + Tile::Forest => asset_server.load("tiles/grass.png"), + Tile::Hill => asset_server.load("tiles/grass.png"), } } } @@ -39,15 +36,17 @@ fn render_map( ) { for (entity, position, tile) in query.iter() { let pixel_position_ratio = position.to_pixel_coordinates(); - let position_x = (IMAGE_WIDTH / 2. + OFFSET) * pixel_position_ratio.x; - let position_y = pixel_position_ratio.y * (IMAGE_WIDTH / 3. + OFFSET); + let position_x = 70. * pixel_position_ratio.x; + let position_y = pixel_position_ratio.y * 40.; commands.entity(entity).insert(SpriteBundle { - transform: Transform::from_translation(Vec3 { + transform: Transform { translation: Vec3 { x: position_x, y: position_y, z: -1.0 / (1.0 + (-position_y * 10_f64.powf(-5.0) as f32).exp()), - }), + + }, + scale: Vec3 {x: 1./10., y: 1./10., z: 1.0}, ..Default::default()}, texture: tile.get_texture(&*asset_server), ..default() });