Open SimplyLiz opened 6 years ago
The way I’ve handled this in OpenSC2K is to have a reference to the correct tile for each rotation within the definition of the tiles that are to be rotated. This means for a slope tile with an ID of 257, it contains a reference to the other slope tiles that coorespond to the rotated map views. In this case, the tile definition contains an array of 4 values, [257, 258, 259, 260] - one for each of the map rotation “directions, 0 through 3.
Not the most elegant solution, but it solved for some odd cases such as road/bridge tiles which only have two rotation variants instead of 4. Tiles that display the same tile in every rotation don’t have the array and are just displayed as-is on all 4 rotation variants.
Implement map rotation.
The mapnode matrix should be rotated in 4 positions (by 90° only).
We need to rotate the iso coordinates of the mapnodes (draw the nodes to another destionation), + the nodes it self (drawing order) and then probably run updateTextures to recalculate the destRect where the nodes are drawn
I've started to work on this at this branch: https://github.com/JimmySnails/IsometricEngine/tree/rotateMap
My approach was to rotate the whole map cell matrix, which didn't turn out the way it should have.