pbivens67 said: this code works but I want to draw a tile next to the center tile.
Working code is always nice. I am not sure I get what all the variables mean.
X and Y are probably numbers of a coordinate pairs? You seem to have a “cart” pair as input and a “iso” pair as output? So what coordinate system does the “cart” pair represent in your working code? What coordinate system is the “iso” pair using?
If I move from (0, 0) in cart to (1, 0), how does “iso”move? If I move from (0, 0) in cart to (0, 1), how does “iso” move?
If you copy/paste the grass function to the grass_two function, and only change the y coordinate in the second function, then sure, the second tile gets drawn below the first one. The screen still has the same vertical y and horizontal x coordinates as with all your previous programs.It doesn't change its coordinate system if you don't tell it how to do that.
For an isometric world, both x and y change with each tile.
The isometric to screen xy coordinates conversion code that you have should be able to provide needed x and y for each tile.
Best solution to paint a tile is 1) compute the xy position of tile with your isometric conversion, and 2) draw the tile at the computed coordinates. All in 1 function.