Giter VIP home page Giter VIP logo

bevy_ecs_tilemap's Introduction

bevy_ecs_tilemap

A tilemap rendering plugin for bevy which is more ECS friendly by having an entity per tile.

Features

  • A tile per entity
  • Fast rendering using a chunked approach.
  • Layers and sparse tile maps.
  • GPU powered animations
  • Isometric and Hexagonal tile maps

Upcoming Features

  • Support for isometric and hexagon rendering done
  • Built in animation support. done see animation example
  • Texture array support
  • Layers and add/remove tiles. (High Priority) done

Screenshots

iso hex

How this works?

Quite simple there is a tile per entity. Behind the scenes the tiles are split into chunks that each have their own mesh which is sent to the GPU in an optimal way.

Why use this over another bevy tile map plugin?

Because each tile is an entity of its own editing tiles is super easy, and convenient. This allows you tag entities for updating and makes stuff like animation easier. Want to have a mining simulation where damage is applied to tiles? That's easy with this plugin:

struct Damage {
    amount: u32,
}

fn update_damage(
    mut query: Query<(&mut Tile, &Damage), Changed<Damage>>,
) {
    for (mut tile, damage) in query.iter_mut() {
        tile.texture_index = TILE_DAMAGE_OFFSET + damage.amount;
    }
}

Examples

  • accessing_tiles - An example showing how one can access tiles from the map object by using tile map coordinates.
  • animation - Basic cpu animation example.
  • bench - A stress test of the map rendering system. Takes a while to load.
  • dynamic_map - A random map that is only partial filled with tiles that changes every so often.
  • game_of_life - A game of life simulator.
  • hex_column - A map that is meshed using "pointy" hexagons.
  • hex_row - A map that is meshed using flat hexagons.
  • iso - An isometric meshed map.
  • layers - An example of how you can use multiple map entities/components for "layers".
  • map - The simplest example of how to create a tile map.
  • random_map - A bench of editing all of the tiles every 100 ms.
  • remove_tiles - An example showing how you can remove tiles by using map_query
  • sparse_tiles - An example showing how to generate a map where not all of the tiles exist for a given square in the tile map.
  • visibility - An example showcasing visibility of tiles and chunks.

Running examples

cargo run --release --example map

Known Issues

  • None(Please report any issues!)

Asset credits

bevy_ecs_tilemap's People

Contributors

forbjok avatar martinmolin avatar stararawn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.