In my RND I have come upon a method to use two Boards, one for use with movement logic, and the other for tile/sprite placement. The movement logic Board has more cells (x2 or x4) than the placement Board.
The movement Board is referred to as the MBoard, and the graphics Board is referred to as GBoard. Each Board has its own SquareTx object, MSquareTx and BSquareTx, respectively.
The SquareTx defines the physical dimensions of the Board, so each must be configured for its purpose. (MBoard/GBoard will be referred to inclusive of their SquareTx associations).
The GBoard’s purpose to place tiles. The GBoard’s cell sizes are bigger in order to fit more unique looking graphics and cover more ground using tiles (instead of Tiled Image Objects).
The GBoard is essentially what is depicted in the Tiled editor.
The MBoard is derivation of the GBoard. It’s constructed alongside the GBoard when it is read from the TMX.
The MBoard essentially subdivides the GBoard’s bigger tiles so that it would have 4x-8x more tiles, depending on the desired subdivision.
- Create GBoard and MBoard
- Create GSquareTx and MSquareTx. Associate with respective Boards.
- Create SLG. Associate SLG with MBoard.
- Create placement tile for MBoard. This can be any tile, but it must cover one cell size of MBoard in order to register a click predictably.
- SquareTx offsets tne cell widths are set, and Board width/height are set accordingly:
Some orthogonal-related functions must reflect the different coordinates.
In OXY2LXY (OrthoXY to LogicXY), the logical return value will obviously be different because of the different cell size.
All functions that use the SquareTx as a point of reference must have their own function for each board.
It is best to use two different Text objects to debug the cells of the two Boards.