So I’m having a problem, I don’t know how to handle objects that are made of multiple tiles such as big trees.
I’m making a rpg, so what I want is to be able to chop those trees. if it was made of 1 tile, it would be no problem. but since it’s not I’ll have problems with multiple sizes of trees. What I want to do is go through an “groundobject” layer and scan through the tiles, load and store the object’s properties such as the name of the tree and the name of the action which in this case would be Chop treeName.
Does anyone know a neat solution to this? I don’t want to hardcode all different sizes.
I’m a big fan of polygon-based maps rather than tile-based. That way you can have your tiles but also have oddly sized/shapen objects like trees.
What I also could do is load objects from a file and make entity objects out of them. they will get a texture region assigned appropriate to their id so it will do something like “objects/”+objectId+".png" this is a solution but it makes adding objects a bit harder. Since I won’t be able to use Tiled for it.
Why not just use a dummy tile for objects? “tree_seed” or something, so when you load in your tiled map, you just swap out tree_seed with a tree of a random size? Then you can add trees with tiled, and they’ll be handled in game with your entity code.
Hhhm yeah I can create a separate layer and set opacity to 0%. All that’s left then is to only render objects within viewport.
Or you can make the trunk of the tree the size of one tile and then have the tree’s leaves and branches be above the player so that the player walks under it to chop it.