Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm having a confusing experience with a Tile layer #176

Open
LinkBenjamin opened this issue Aug 15, 2023 · 0 comments
Open

I'm having a confusing experience with a Tile layer #176

LinkBenjamin opened this issue Aug 15, 2023 · 0 comments

Comments

@LinkBenjamin
Copy link

LinkBenjamin commented Aug 15, 2023

I created my map in Tiled, and I have multiple layers - a ground layer, an invisible layer for boundaries, and another Tile layer with the items that are in my world.

I've loaded the various layers into a dictionary:

layouts = {
    'boundary': tmx_data.get_layer_by_name('Barriers'),
    'objects': tmx_data.get_layer_by_name('Objects'),
    ...
}

I can iterate on the 'boundary' layout above - since it's not a visible layer and each space is either blank or filled with a barrier, it's working fine.

The problem arises when I try to display the objects in the world. I think I'm supposed to do this to get the images:

for x, y, image in layouts['objects'].tiles():
    if(image != None):
        Tile(x,y,[self.visible_sprites], 'objects', image)

None of my objects actually appear to == something besides None. I definitely have objects in the layer. Any ideas what I've missed?

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

No branches or pull requests

1 participant