Skip to content

Commit

Permalink
Removed unused tmx file. Removed colors example changes. Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
StarArawn committed Mar 26, 2023
1 parent 0970953 commit 02e9a46
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 33 deletions.
20 changes: 0 additions & 20 deletions assets/iso_map2.tmx

This file was deleted.

2 changes: 1 addition & 1 deletion examples/3d_iso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() {
App::new()
.insert_resource(TilemapRenderSettings {
// Map size is 12x12 so we'll have render chunks that are:
// 12 tiles wide and 1 tile tall.
// 12 tiles wide and 1 tile tall.
render_chunk_size: UVec2::new(3, 1),
})
.add_plugins(
Expand Down
10 changes: 0 additions & 10 deletions examples/colors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;
use rand::{thread_rng, Rng};

mod helpers;

Expand Down Expand Up @@ -91,14 +90,6 @@ fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
});
}

fn change_color(mut query: Query<&mut TileColor>) {
let mut random = thread_rng();

for mut color in query.iter_mut() {
*color = TileColor(Color::rgb(random.gen(), random.gen(), random.gen()));
}
}

fn main() {
App::new()
.add_plugins(
Expand All @@ -115,6 +106,5 @@ fn main() {
.add_plugin(TilemapPlugin)
.add_startup_system(startup)
.add_system(helpers::camera::movement)
.add_system(change_color)
.run();
}
2 changes: 1 addition & 1 deletion examples/helpers/tiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub fn process_loaded_maps(
for y in 0..map_size.y {
// Transform TMX coords into bevy coords.
let mapped_y = tiled_map.map.height - 1 - y;

let mapped_x = x as i32;
let mapped_y = mapped_y as i32;

Expand Down
5 changes: 4 additions & 1 deletion src/render/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ pub fn queue_meshes(
};

let pipeline_id = pipelines.specialize(&pipeline_cache, &tilemap_pipeline, key);
let z = transform.translation.z + (1.0 - (transform.translation.y / (chunk.map_size.y as f32 * chunk.tile_size.y)));
let z = transform.translation.z
+ (1.0
- (transform.translation.y
/ (chunk.map_size.y as f32 * chunk.tile_size.y)));
transparent_phase.add(Transparent2d {
entity,
draw_function: draw_tilemap,
Expand Down

0 comments on commit 02e9a46

Please sign in to comment.