An alternate solution would be to instead figure out the model based on the graphics used for the tiles. For example, grass would be marked as non-blocking while rock walls would be 'blocking'. However, this is still too much coupling, since it makes things like invisible barriers--or perhaps walls you can walk through--impossible.
So, I decided to completely decouple tile models from graphics. I added a separate Model property to Tiles, which is controlled via a context menu (and copy-paste) in the editor. Currently there are only 3 model types--Empty, Solid, and Triangle (any of which can be rotated, but currently it only makes sense for Triangle).
The following video shows me walking around with no models, running the editor and adding some models, and finally walking around with the models properly set for the rock structure on the left.
No comments:
Post a Comment