Re:Hexagonal grids for games
by sillysaurus on Sunday June 02, 2013 @06:57PM
(#5810422)
Well, you'll want to think one level of abstraction higher than that. Imagine a camera. When you push a camera forward towards a wall, the wall stays the same size. It just fills more of your view.
You can code the equivalent of that pretty simply. So even if a png is 13x13, it might be drawn as 30x30 if the camera zooms in, or as 5x5 if the camera zooms out.
It's actually much simpler (and more visually consistent) to do it that way. It's probably more difficult to learn, but it's well worth the time spent learning it.
A 13×13 .png of line art stretched to 30×30 or 5×5 is gonna look pretty ugly[1]. Am I misinterpreting you?
[1] I tried it: http://toxicsli.me/file/hexes.png Leftmost is original, others resized.
Re:Hexagonal grids for games
by sillysaurus on Sunday June 02, 2013 @07:32PM
(#5810521)
Well, two things to consider: (a) that particular example looks fine to me on a MacBook Pro in Chrome, and (b) you've discovered the motivation for mipmapping.
Re:Hexagonal grids for games
by jonmrodriguez on Sunday June 02, 2013 @07:21PM
(#5810494)
Use vector image files
In fact, the way it is now, you can change one constant in the code to make the board size anything you like — 10×10, 13×13, 19×19, whatever, and it adjusts the hex cells' size to fit in the same page layout. This'll be exposed in the UI if I ever get back to the project.