Skip to content

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

@LinkBenjamin

Description

@LinkBenjamin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions