Taking a victory lap on today's hobby hacking game dev progress. Camera control! The camera now follows the player, but not beyond the extent of the tilemap.

#BevyEngine

@unormal how many more days of vacation do I need to go from here to Qud?
@unormal I can't decide if this would be more fun or a lot less fun if it were my job to make this.
@onelson I dunno like 16 or 20 maybe?
@onelson looks sweet :D
@unormal I bought all this art on the itch.io asset store. Planning to port this to unity tomorrow since I'm hard up for reasons to hate my life.
@onelson 10/10 game so far, the character sprite is a big plus
@ojii I see what you did there but also know at one point I put a pair of eyes on it.

@onelson VERY cool!

Since, I will need to implement something similar in an upcoming project: Do you know whether bevy automatically only renders the visible part of the tile map or does it always render the entire map, then just crops the image appropriately?

@BafDyce I'm delegating the tile rendering to https://github.com/Trouv/bevy_ecs_ldtk and I haven't checked the details.

My guess is it's less sophisticated, rendering all the tiles out as a texture on a quad in one shot. I've got data in the LDtK scene to tell me which tiles are which type of terrain, and in that situation I have more control -- I could look the data up from the scene ad hoc. I'm not though, I'm building a map of tile offsets and their types up front.

GitHub - Trouv/bevy_ecs_ldtk: ECS-friendly ldtk plugin for bevy, leveraging bevy_ecs_tilemap

ECS-friendly ldtk plugin for bevy, leveraging bevy_ecs_tilemap - Trouv/bevy_ecs_ldtk

GitHub

@onelson I see, thanks! Last time I checked (2ish years ago?) this crate didnt exist yet (or I was unable to find it?)

Definitely makes me wanting to start the project *now* 😂

@BafDyce I only recently found out about LDtK. I had always tried working with Tiled in the past, but LDtK seems much more user-friendly.

The crate I linked is built on top of a separate one which mostly covers the types used to parse the JSON scene files.

FYI, I struggled to reconcile the differing coordinate systems. LDtK is Y-down, vs Bevy's Y-up. Figuring out which parts of the API use which system was a bother, but I think I'm past that now 😅

@onelson Uh, sounds like I will have quite the journey in front of me 😂

@BafDyce I just wanted to be sure to disclose 😅

There's a bunch of coordinate conversion helper functions in the crate but I should have looked at their bodies long before I actually did. None of them did the math I needed to pull the data I wanted out of the scene. Had to write my own.