Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Bevy Tilemap 0.2.2

Compare
Choose a tag to compare
@joshuajbouw joshuajbouw released this 22 Nov 19:10
· 100 commits to master since this release
e4fba20

Added

  • Tilemap::clear_tile was added to easily clear a single tile.
  • Tilemap::clear_tiles likewise will clear an array of tiles.
  • Point2 now implements From<&Point2>.
  • Point3 now implements From<&Point3>.
  • tilemap::Tilemap::set_tiles now implements
    IntoIterator<Item = ((i32, i32, i32), Tile)> which had broken the previous
    compatibility.
  • tile::Tile had the non_exhaustive derive added it now that the fields are
    all public.
  • tile::Tile added methods with_tint and with_tint_and_z_order.
  • chunk_update_system was added internally to manage chunks and to get them to
    update if needed.

Changed

  • random_dungeon example was updated to be interactive.
  • Tilemap::set_tiles was changed to take in a IntoIterator<Item = Tile<P, C>,
    where C is Into<Color> and P is Into<Point2>, from
    IntoIterator<Item = (i32, i32, i32), Tile>.
  • tile::Tile was changed to include z_order, sprite_index, and point.
    Field color is now tint. All fields were made public.
  • tile::Tile methods default, new updated.
  • ChunkDimensions was made private, it should never of been exposed but I also
    very much doubt anyone would have used it.
  • map_system was made private, it should never of been exposed.
  • add_tile was renamed to insert_tile.
  • add_tiles was renamed to insert_tiles.
  • clear_tile was renamed to remove_tile.
  • clear_tiles was renamed to remove_tiles.

Before

let z_order = 0;
let point = (1, 1, z_order)
let tile = Tile::new(0);
let tiles = vec![(point, tile)];
 
// defined elsewhere
tilemap.set_tiles(tiles).unwrap();

After

let point = (1, 1);
let z_order = 0;
let tiles = vec![Tile::new(point, z_order)];

// defined elsewhere
tilemap.set_tiles(tiles).unwrap();
  • Tilemap::set_tile was changed to take in Tile<P, C>, where P is
    Into<Point2> and C is Into<Color>. This replaces the previous argument
    P and T where T was Into<Tile>.

Before

let point = (9, 3, 0);
let sprite_index = 3;
let tile = Tile::new(sprite_index);

// defined elsewhere
tilemap.set(point, tile).unwrap();

After

let point = (9, 3);
let sprite_index = 3;
let tile = Tile::new(point, sprite_index);

tilemap.set_tile(tile).unwrap();

Removed

  • tile::Tiles was removed as it is no longer needed as all data as been set
    into Tile to make everything easier.
  • tile::Tiles was removed from prelude.
  • tile::Tile methods index and color were removed as the fields are now
    public.
  • tile::Tile all <Into<Tile>> implements were removed.

Upgrade notes

This was a good release to really start using the project with something. Adding it to my own game as well as building the interactive example really was eye opening on what I needed and what was missing. This is getting really close! Unfortunately, going to have to give up on setting deprecations until there is an actual stable release when all major milestones are completed and many examples are created to handle most use-cases.

Key points

  • Random Dungeon was updated to be interactive.
  • add_ for tiles was renamed to insert_ to be more exact. As well as remove_ instead of clear.
  • A system was added to handle chunks and update them when appropriate.