All Projects → joshuajbouw → bevy_tilemap

joshuajbouw / bevy_tilemap

Licence: MIT license
Tilemap with chunks for the Bevy game engine.

Programming Languages

rust
11053 projects
GLSL
2045 projects

Projects that are alternatives of or similar to bevy tilemap

bevy-robbo
Port of mrk-its/rust-robbo to bevy
Stars: ✭ 33 (-80.47%)
Mutual labels:  bevy
bevy transform gizmo
A 3d gizmo for transforming entities in Bevy.
Stars: ✭ 41 (-75.74%)
Mutual labels:  bevy
safe-tea
🍵 Pirate-themed tower defense game for the Feb 2018 http://elmgames.club/ challenge
Stars: ✭ 14 (-91.72%)
Mutual labels:  game-jam
bevy
A refreshingly simple data-driven game engine built in Rust
Stars: ✭ 15,920 (+9320.12%)
Mutual labels:  bevy
bevy kira audio
A Bevy plugin to use Kira for game audio
Stars: ✭ 99 (-41.42%)
Mutual labels:  bevy
bialjam17
💫 The game that won the BialJam'17 event
Stars: ✭ 55 (-67.46%)
Mutual labels:  game-jam
rgis
Performant, cross-platform (web, desktop) GIS app written in Rust
Stars: ✭ 79 (-53.25%)
Mutual labels:  bevy
Magictools
🎮 📝 A list of Game Development resources to make magic happen.
Stars: ✭ 8,853 (+5138.46%)
Mutual labels:  game-jam
taileater
A puzzle game where you eat your own tail to win!
Stars: ✭ 19 (-88.76%)
Mutual labels:  bevy
gbjam8
A Game Boy demake of The Binding of Isaac made for GBJAM8.
Stars: ✭ 18 (-89.35%)
Mutual labels:  game-jam
bevy easings
Helpers and Plugins for Bevy
Stars: ✭ 83 (-50.89%)
Mutual labels:  bevy
space
A SCI-FI community game server simulating space(ships). Built from the ground up to support moddable online action multiplayer and roleplay!
Stars: ✭ 25 (-85.21%)
Mutual labels:  bevy
OneHourGameJam
One Hour Game Jam website
Stars: ✭ 27 (-84.02%)
Mutual labels:  game-jam
bevy 4x camera
A 4X style camera for bevy.
Stars: ✭ 26 (-84.62%)
Mutual labels:  bevy
onut
onut. A little framework to make games in C++ or JavaScript
Stars: ✭ 40 (-76.33%)
Mutual labels:  game-jam
bevy retrograde
Plugin pack for making 2D games with Bevy
Stars: ✭ 212 (+25.44%)
Mutual labels:  bevy
kurinji
Kurinji Input Map aims to decouple game play code from device specific input api. This is achieved by providing apis that allows you to map game actions to device input events instead of directly handling device inputs.
Stars: ✭ 47 (-72.19%)
Mutual labels:  bevy
Gamedev Resources
🎮 🎲 A wonderful list of Game Development resources.
Stars: ✭ 2,054 (+1115.38%)
Mutual labels:  game-jam
libgdx-template
🎮 Starter project for libGDX. Perfect for Game Jams.
Stars: ✭ 18 (-89.35%)
Mutual labels:  game-jam
friendlyfiregame
Explore the world of “Friendly Fire” and meet all its inhabitants in a quest to save the world from an unknown destiny.
Stars: ✭ 64 (-62.13%)
Mutual labels:  game-jam

Bevy Tilemap

Bevy Tilemap logo

Chunk based tilemap for Bevy game engine.

Bevy Tilemap allows for Bevy native batch-rendered tiles in maps to be constructed with chunk based loading, efficiently.

Simple yet refined in its implementation, it is meant to attach to other extensible plugins that can enhance its functionality further. Hand-crafted tilemaps with an attentive focus on performance, and low data usage.

WARNING

This project is still experimental and the API will likely break often before the first release. It uses an experimental game engine which too may break the API. Semantic versioning will be followed as much as possible and the contributors will as much as they possibly can try to keep the API stable.

If you have API suggestions, now is the time to do it.

Features

  • Perfect for game jams.
  • Easy to use and mostly stable API with thorough documentation.
  • Endless or constrained dimension tilemaps.
  • Batched rendering of many tiles.
  • Square and hex tiles.

Build Features

  • Serde support
  • Extra types

Design

This is not intended to be just another Tilemap. It is meant to be a framework and extensible by design, like Bevy. As well as work done to keep it as close to Bevy API as possible while keeping in mind of Rust API best practices. It is not meant to be complicated and created to be simple to use but give enough functionality to advanced users.

Less time fiddling, more time building

Usage

Add to your Cargo.toml file:

[dependencies]
bevy = "0.5"
bevy_tilemap = "0.4"

Simple tilemap construction

At the most basic implementation, there is not a whole lot that is required to get the tilemap going as shown below.

use bevy_tilemap::prelude::*;
use bevy::asset::HandleId;
use bevy::prelude::*;

// Build a default Tilemap with 32x32 pixel tiles.
let mut tilemap = Tilemap::default();

// We need a Asset<TextureAtlas>. For this example we get a random one as a placeholder.
let texture_atlas_handle = Handle::weak(HandleId::random::<TextureAtlas>());

// Set the texture atlas for the Tilemap
tilemap.set_texture_atlas(texture_atlas_handle);

// Create tile data
let tile = Tile {
    // 2D location x,y (units are in tiles)
    point: (16,16),
    
    // Which tile from the TextureAtlas
    sprite_index: 0,
    
    // Which z-layer in the Tilemap (0-up)
    sprite_order: 0,
    
    // Give the tile an optional green tint
    tint: bevy::render::color::Color::GREEN,
    };

// Insert a single tile
tilemap.insert_tile( tile);

Of course, using the Tilemap::builder() this can be constructed with many more advanced features.

  • 3D and 2D tilemaps.
  • Texture atlas.
  • Dimensions of the tilemap.
  • Dimensions of a chunk.
  • Dimensions of a tile.
  • Adding Z render layers
  • Automated chunk creation.
  • Auto-spawning of tiles based on view.

With many more features planned for future updates to bring it up to par with other tilemap implementations for other projects.

Future plans

There is still a lot to do but the API is now stable and should be fine for a while now. The next release is focused on added automated methods and system.

  • Auto-tile: Picks the right tile based around the neighbours of the tile.
  • Tile import: Imports tiles from a file from multiple formats.

Building

bevy_tilemap is only guaranteed to work from stable Rust toolchain and up. This is to be inline with the rest of Bevy engine.

Once you have a development environment, Bevy Tilemap can be fetched using git:

$ git clone --recursive https://github.com/joshuajbouw/bevy_tilemap/

and then built using cargo:

$ cargo build --example random_dungeon

cargo can also be used to run tests:

$ cargo test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].