Feb-18-2020, 06:51 PM
(This post was last modified: Feb-18-2020, 06:51 PM by michael1789.)
(Feb-17-2020, 11:58 AM)Piethon Wrote: Probably I could change these numbers, to make an isometric grid. But I don't know how to change them. Do you think that could solve my problem?
I don't think so. Looking at you pics, while the individual tiles are at the proper 45degree orientation, they are blit to the screen in a straight pattern across the screen. If we look at your isometric picture and take the top as the first tile, then the next is (x =+ TILESIZE / 2, y =+ TILESIZE / 2). But your program blits at x += TILESIZE. It's just writing them across instead of at the right angle.
nilamo, might be better help with deciphering the .tmx, but I can't read it.
I think the problem needs to be fixed here:
for x, y, gid, in layer: tile = ti(gid) if tile: surface.blit(tile, (x * self.tmxdata.tilewidth, y * self.tmxdata.tileheight))I really think there needs to be an offset figured out to put here
x * self.tmxdata.tilewidth + OFFESETWhat that is would be the problem. It might be simple. Just to test the theory, try this and see what it looks like.
surface.blit(tile, (x * self.tmxdata.tilewidth / 2, y * (self.tmxdata.tileheight * 1.5) ))It think it will show a mess, but it might let us know we are on the right track. I suspect that in the end that the OFFSET will have to be a complex variable that tracks the rows and offsets the starting position, but who knows... that might fix it.