Hello all, I'm wondering if anyone here knows how to create a hexagonal tile based game in blitzplus? I've only been using blitz for about two weeks now, so I'm sure the answer is right in front of me! However, any tips, or source code examples would be most welcome.
Hex tiles??
Blitz3D Forums/Blitz3D Beginners Area/Hex tiles?? I think mappy (tile map editor) has blitz ready code for displaying hex tile maps.
Damn that was fast! It looks like just what I need, thankyou.
I've been fighting with hex tiles for 10 years... I decided to go with square ones. Displaying them was never an issue. Only with selecting them. :)
Sounds like I've got my work cut out for me...damn those hexagons:P
been there... read that... my eyes look at it but my brain refuses to. :)
Knocked this up, I hope it helps :)
Graphics 640,480 img=CreateImage(13,16) Restore image For a=0 To 15 For b=0 To 12 Read c WritePixel b,a,(255+255*256+255*256*256)*c,ImageBuffer(img) Next Next img2=CreateImage(13,16) Restore image For a=0 To 15 For b=0 To 12 Read c WritePixel b,a,(255*256*256)*c,ImageBuffer(img2) Next Next Dim map(15,15) For a=0 To 15 For b=0 To 15 map(a,b)=img If Rand(0,5)=0 Then map(a,b)=img2 Next Next xview=0 yview=0 While Not KeyHit(1) If KeyDown(205) Then xview=xview+5 If KeyDown(203) Then xview=xview-5 If KeyDown(200) Then yview=yview-5 If KeyDown(208) Then yview=yview+5 Cls For a=0 To 15 For b=0 To 15 DrawImage map(a,b),a*14+b*7-xview,b*13-yview Next Next Flip ; Delay 20 Wend .image Data 0,0,0,0,0,0,1,0,0,0,0,0,0 Data 0,0,0,0,1,1,1,1,1,0,0,0,0 Data 0,0,0,1,1,1,1,1,1,1,0,0,0 Data 0,1,1,1,1,1,1,1,1,1,1,1,0 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 1,1,1,1,1,1,1,1,1,1,1,1,1 Data 0,1,1,1,1,1,1,1,1,1,1,1,0 Data 0,0,0,1,1,1,1,1,1,1,0,0,0 Data 0,0,0,0,1,1,1,1,1,0,0,0,0 Data 0,0,0,0,0,0,1,0,0,0,0,0,0
Check out this free map editor:
www.blitzbase.de/_mapeditor
I believe that it will be available soon.
(I am currently helping translate the website and help docs to english.)
www.blitzbase.de/_mapeditor
I believe that it will be available soon.
(I am currently helping translate the website and help docs to english.)
I've done quite a few tile-engines, but Hex tiles is the most difficult one to create.
Mostly because of the odd coordinate system which is a little difficult to convert to normal array lookups and such..
Its mainly the way you think about the system, but if you write wrapper functions, you can easier continue with it and use regular square map thinking :)
Mouse-tile coordinates isn't that difficult to do, just ask me if you need any help.
Mostly because of the odd coordinate system which is a little difficult to convert to normal array lookups and such..
Its mainly the way you think about the system, but if you write wrapper functions, you can easier continue with it and use regular square map thinking :)
Mouse-tile coordinates isn't that difficult to do, just ask me if you need any help.
I wrangled together a hex tile system for selecting and shading hex tiles. Man, was that ever nasty to figure out! A hex tiling system would definitely be a great idea.