Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help on some hexagon tile code.
#1
I'm busy coding a hexagon tile map engine, but i've encountered a problem and can't really solve it.

FOR x = 0 TO 15
FOR y = 0 TO 12
put (x * 40 - xpos, y * 40 - ypos + (x AND 1)*20), VARPTR(tiles(72 * 3204)), TRANS
NEXT
NEXT

this tile layer got properly drawn on the map but when i move the camera to the left or right, the logical calculation puts my layer 20 pixels down, i got this method from a tutorial and don't know how to handle this. Any help will be appreciated Smile


here's the exec. of my engine
http://s10.yousendit.com/d.aspx?id=3CVJ3...MQOJ0PXXNQ
Reply
#2
Ok i figured it out, I had to change the (x and 1) to (x + xtile and 1).
The exact x pointer in the mapdata.

the x was just the plotting pointer.
Reply
#3
sorry I had/have no help to offer, but I did think it looked pretty cool. Smile
[Image: freebasic.png]
Reply
#4
LOL, now i downloaded myself and i noticed i uploaded an old QB project. Wink

It was meant to be a FB program i had uploaded.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)