diff --git a/crates/border-wars/src/map/renderer.rs b/crates/border-wars/src/map/renderer.rs index f5bb809..48bd9a0 100644 --- a/crates/border-wars/src/map/renderer.rs +++ b/crates/border-wars/src/map/renderer.rs @@ -18,9 +18,9 @@ impl Plugin for RendererPlugin { } } -/// The offset between the center of the tiles in the map. +/// The gap between the center of the tiles in the map. #[derive(Resource)] -struct TilesOffset(Vec2); +struct TilesGap(Vec2); /// The size of the tiles in the map. #[derive(Resource, Clone, Copy)] @@ -54,7 +54,7 @@ impl Tile { /// Init resources related to the rendering of the map. fn init_resources_for_rendering(mut commands: Commands) { - commands.insert_resource(TilesOffset(Vec2 { x: 70., y: 40. })); + commands.insert_resource(TilesGap(Vec2 { x: 70., y: 40. })); commands.insert_resource(TilesSize(Vec2 { x: 125., y: 100. })) } @@ -63,13 +63,13 @@ fn render_map( query: Query<(Entity, &TilePosition, &Tile), Changed>, mut commands: Commands, asset_server: Res, - tiles_offset: Res, + tiles_gap: Res, tiles_size: Res, ) { for (entity, position, tile) in query.iter() { let texture = tile.get_texture(&asset_server); - let translation_2d = tiles_offset.0 * position.to_pixel_coordinates(); + let translation_2d = tiles_gap.0 * position.to_pixel_coordinates(); let translation = Vec3::new( translation_2d.x, translation_2d.y,