VBGamer |
|||||||||||||||||||||||||||
some math help CI Games (1 reply, 0 views) (2001-Jul-25) i need some help on a few math instructions:
-------------------------------------------
- I have an isometric map with 99x89 tiles
- The tile dimenions are 66x33 (WIDTHxHEIGHT)
- I declare the tiles using this code:
Dim Tile(99,89) as typeTILE
- My current code look like this: (yes, its very unproffesional)
//cTilex = width of tile (66)
//cTiley = height of tile (33)
For vert = y(0) To y(1)
//bslide is a boolean, it togles the tile shifting
bslide(0) = Not bslide(0)
For horiz = x(0) To x(1)
If bslide(0) = False Then
tX = ((horiz * cTilex) - MapOffsetX)
ty = ((vert * cTiley) - MapOffsetY) + (cTiley)
Else
tX = ((horiz * cTilex) - MapOffsetX) + (cTilex \ 2)
ty = ((vert * cTiley) - MapOffsetY) - (cTiley \ 2)
End If
With tileGround(horiz, vert)
SetVertex .Vertex(), tX, ty, cTilex, cTiley
End With
Next horiz
Next vert
- The only problem is that it's not accurate! When I want to render my tiles how would I setup each tile so that it would no leave any spaces between them?
|