Comments (6)
The tile entities are already in an array. You'll want to look at:
get_tile_entity
https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/src/map_query.rs#L144
get_tile_neighbors
https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/src/map_query.rs#L144
You can also see an implementation of astar here:
https://github.com/StarArawn/bevy_roguelike_prototype/blob/main/src/game/map/generate_map.rs#L87
from bevy_ecs_tilemap.
Thx for the links this helps a lot
i dont want to start a new thread, but have another question, not sure if its with tilemap or bevy, but how would i setup a query where i loop through all the tiles in a particular chunk?
from bevy_ecs_tilemap.
Thx for the links this helps a lot
i dont want to start a new thread, but have another question, not sure if its with tilemap or bevy, but how would i setup a query where i loop through all the tiles in a particular chunk?
Chunks are mainly meant to be a rendering optimization technique only, but if you really need to you can access the chunks via the map entity. You can't or rather wont be able to use map_query in this instance as it doesn't expose chunks. You can look at the logic for grabbing a chunk though and use something similar in your own code.
Once you have a chunk you can use:
https://github.com/StarArawn/bevy_ecs_tilemap/blob/main/src/chunk.rs#L183
from bevy_ecs_tilemap.
Thank you for all the replies
now my goal is just to divide the load into several frames, dont iterate through all tiles, i thought that each frame just iterate through a single chunk tiles would be nice, but is this the bevy way, is there a better way to do this?
from bevy_ecs_tilemap.
Thank you for all the replies
now my goal is just to divide the load into several frames, don't iterate through all tiles, i thought that each frame just iterate through a single chunk tiles would be nice, but is this the bevy way, is there a better way to do this?
I wouldn't necessarily say its the bevy way, as bevy is quite flexible, but I can understand the need to do this. It might be a better idea to keep track of tile entities(I would use tile position) yourself using some sort of hierarchical storage. HPA* comes to mind.
https://docs.rs/hierarchical_pathfinding/0.4.3/hierarchical_pathfinding/
from bevy_ecs_tilemap.
thank you again for the reply, help a lot
from bevy_ecs_tilemap.
Related Issues (20)
- Incorrect usage of rs-tiled HOT 4
- Errors in helpers/tiled.rs HOT 2
- Correct process to add a Collider HOT 5
- AnimatedTile add/remove bug HOT 2
- 0.12 bug: despawn + spawn during state change, without spawning texture, panics
- Wrong tiles placement when images height are superior to tiles height with isometric maps HOT 3
- TileStorage, TilemapSize, TileTextureIndex, TilePos are not Components anymore. HOT 2
- Obscure error in 'basic' example with slight modifications. HOT 3
- Update to Bevy 0.14 HOT 7
- could some one turn this in to an example ?
- Compile error: crate-private type `RenderChunkSize` in public interface HOT 6
- Instead ov `src/map/mod.rs`, it should just be `src/map.rs`. HOT 2
- Bevy 0.13 race condition resulting in tiles not rendering HOT 2
- Auditing examples on main after updating to Bevy 0.13 HOT 2
- Improve Tiled support HOT 3
- how to make a tilemap with atlas? HOT 3
- Does not render anything on my machine HOT 3
- Manage z-index with spritesheet moving character HOT 1
- layers and moving sprites HOT 4
- I have a problem with bevy 0.13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy_ecs_tilemap.