fn build_map(
	tilesets: Tilesets,
	mut commands: Commands,
	mut map_query: MapQuery,
	mut local_state: Local<BuildMapState>,
) {
	if local_state.built {
		// Only build the map once
		return;
	}

	// We can get our tileset by name or ID. We could also use the handle we stored in `MyTileset` by calling:
	// ```
	// if let Some(tileset) = tilesets.get(&my_tileset.handle.unwrap()) {
	// ```
	if let Some(tileset) = tilesets.get_by_name(MY_TILESET) {
		println!("{:#?}", tileset);

		// === Settings === //
		let map_size = MapSize(4, 4);
		let chunk_size = ChunkSize(5, 5);
		let layer_count = 3;

		// === Build === //
		helpers::build_map(
			tileset,
			map_size,
			chunk_size,
			layer_count,
			&mut commands,
			&mut map_query,
		);

		local_state.built = true;
	}
}
/// A system used to build the tilemap
A system used to build the tilemap
A system used to build the tilemap
fn build_map(
	tilesets: Tilesets,
	mut commands: Commands,
	mut map_query: MapQuery,
	mut local_state: Local<BuildMapState>,
) {
	if local_state.built {
		// Only build the map once
		return;
	}
	// We can get our tileset by name or ID. We could also use the handle we stored in `MyTileset` by calling:
	// ```
	// if let Some(tileset) = tilesets.get(&my_tileset.handle.unwrap()) {
	// ```
	if let Some(tileset) = tilesets.get_by_name(MY_TILESET) {
		println!("{:#?}", tileset);
		// === Settings === //
		let map_size = MapSize(4, 4);
		let chunk_size = ChunkSize(5, 5);
		let layer_count = 3;
		// === Build === //
		helpers::build_map(
			tileset,
			map_size,
			chunk_size,
			layer_count,
			&mut commands,
			&mut map_query,
		);
		local_state.built = true;
	}
}
fn build_map ( tilesets : Tilesets , mut commands : Commands , mut map_query : MapQuery , mut local_state : Local < BuildMapState > , ) { if local_state . built { // Only build the map once return ; } // We can get our tileset by name or ID. We could also use the handle we stored in `MyTileset` by calling: // ``` // if let Some(tileset) = tilesets.get(&my_tileset.handle.unwrap()) { // ``` if let Some ( tileset ) = tilesets . get_by_name ( MY_TILESET ) { println ! ( " " tileset ) ; // === Settings === // let map_size = MapSize ( 4 , 4 ) ; let chunk_size = ChunkSize ( 5 , 5 ) ; let layer_count = 3 ; // === Build === // helpers :: build_map ( tileset , map_size , chunk_size , layer_count , & mut commands , & mut map_query , ) ; local_state . built = true ; } }
A system used to build the tilemap
A system used to build the tilemap
tilesets
Tilesets
commands
Commands
map_query
MapQuery
local_state
Local<BuildMapState>
tilesets
Tilesets
commands
Commands
map_query
MapQuery
local_state
Local<BuildMapState>