Isometric Tile is a slightly complex place in the rectangle lies in the screen is a rectangular, and the coordinate axes of the world reflecting the world's coordinate axes are different. Whether it is the movement of the elf, it is necessary to pass coordinate transformation. And a screen area It became a rhombic shape on the map of the game world. I think all the first time ISOMETRIC TILE engine has been irritated (her feelings ;-) does not rule out because of this reason to modify their original design Possible ^ _ ^. Actually it is not complicated, but you need to calm down to draw a schematic in white paper. (Note: If you are cheap, you can use a pencil to draw, will only make Your mood is more annoying) or by the habit of Yunfeng to make a picture (recommended to use the convenient graphic library such as the soul ;-) Of course, your AutoCAD is good, it is also very convenient to use ADS. Specific questions, I think each programmer should develop these good habits ;-) Here, the cloud is doing this step. Look at the picture: I am a TILE shape calculated in the previous article, and each map The size of the block is taken from 1: 1. The green box is a 320x240 1/4 screen size map block. The size of the Tile is set to 81x41 Since there is 1 point overlap between Tile, the actual space is 80x40. In addition, I set a TILE in the upper left corner to (0) other TILE to edit the coordinate value in the relative coordinate, which is convenient for everyone to watch. As shown, because Tile is relatively reasonable, it is just in one map. The block is accommodated in the block, so our coordinate transformation is very easy. The relative coordinates of the target in the figure, the upper left corner is (0,0). So we transform the relative coordinate (x, y) Tile to a map The pixel coordinate on the block is (40 * (yx), 20 * (x Y)) one map block, contains 59 TILE, where the edge portion is overlapping around. If our map data is in the game world Coordinate storage. We can see that the 59 Tile X ranges are [-4, 6] Y ranges [-1, 9]. That is to say that at least one 11x11 map description matrix in the game world needs to include The data of this map block. Here, I recommend that the game map description data is saved with 16x16. While loading the image data of several map blocks, we can also calculate the scope of the corresponding map to describe the data. To memory. Two coordinates are in different problems, but we only need to remember two basic formulas. Game The coordinates (x, y) in the world are converted to the screen rectangular coordinate system (X0, Y0) is X0 = a * (yx), Y0 = b * (x y) and the reverse conversion can be calculated as X = (1/2) * (Y0 * 2-x0) / a, y = (1/2) * (Y0 * 2 X0) / a. When calculating the division, you should pay attention to the problem of the positive and negative number. 1/7 is het here to be -1 instead of 0) here A, B is a long-width coefficient of the rectangle, such as the A = 40, b = 20, B = 20, which is mentioned in the previously mentioned conversion formula. (80) half of width (40). Similarly you have to make some operations on the map block; 4 and 6 These two parameters will be used in the field ;-)