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

Allow "frozen" and layers with accessible tiles #52

Open
johnhattan opened this issue Feb 17, 2014 · 3 comments
Open

Allow "frozen" and layers with accessible tiles #52

johnhattan opened this issue Feb 17, 2014 · 3 comments

Comments

@johnhattan
Copy link

As I understand it, an openfl-tiled map (at least in Flash) consists of a single big bitmap containing all layers flattened together. While that's great for terrain or walls or other immutable tiles, it's not friendly for stuff that can change, like open-able doors or collect-able objects or monsters. Putting something in a map that can move or change would require (a) some kind of "refresh a single square" command that I don't think exists or (2) a hack like putting all move-able objects on invisible layers so you can manually add individual sprites for all movable objects or (3) never adding a map to the stage and just writing my own map-builder using the underlying layer/tile data.

Not sure if there's a layer property for it, but it'd be nice if I could say "these layers are frozen" which would make one big flattened bitmap of those layers or "these layers are dynamic" which will make a sparse array of individual sprites.

Apologies in advance if I'm futzing with the design. I've been using openfl-tiled for all of one day and am just looking how things would interact with my design :)

@atomicptr
Copy link
Owner

Since 0.4 I've removed the old "createBitmapData..." methods which allowed you to build your own map with several layers (e.g. draw the layer [0, 2, 4] "frozen" and do some dynamic stuff with the others or whatever). I often use the object groups for dynamic content.

Since 0.4 there is no method for drawing specific layers which is something I intend to change in the future. For now the only way to add dynamic content is to use the TiledMap, Layer and Tile objects.

Actually the whole rendering stuff is something I originally didn't intended to do in openfl-tiled so the API design still needs some work in this regard ;).

@johnhattan
Copy link
Author

Okay, no prob. The rendering stuff seemed fairly simplistic compared to the rest of the objects, so it seems like the preferred method is to just deal with the underlying data myself.

And thanks for writing this thing. It's saving me the hassle of writing a level editor :)

@atomicptr
Copy link
Owner

The rendering stuff is something I'm breaking very often since I'm not really sure how to make this really neat.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants