I like that. Having tile type as an enum or something...
Thu Mar 18, 2021 12:41pm
and then having some TileHandler or something that defines the action based performed based on the tile type. I guess you would also need some sort of id or something to specify that it was, for example, a specific treasure chest on this specific map?
Currently, the only different tile type I have besides blocking/unblocking world tiles are teleport tiles. Those I did as a separate type that are stored using an indexed file. (COBOL file thing that allows you to query files quickly using an indexed field like a database)
The file contains the source x,y, the destination x,y and the destination map file. Source doesn't have a map file name because the map file of the teleport data is the same as the tile map definitions file. (ex: world1.map has tile data and world1.tel has teleport data)
I guess this could be done with setting a tile type on the world tile as "teleport" or something with an id. Then I can query the teleport file based on id to get the action to perform (teleport player from xy to xy in map).