BDS Software

Hex vs. Square - Page 3



The Upper-Left Convention for Squares

Most of my square game maps are 641x641 pixels. Some have 10x10 squares in that space, others have 20x20 squares, others have 40x40 squares, and yet others have 64x64 squares.

I'll be primarily referring to the 10x10 maps here because that will make for improved clarity of details.

Take a look at the 10x10 map below.


Square Map 10x10 Single Point


If the blue pixel (oversized here for visibility) were to be considered as simultaneously part of each and every square that it touched, then it would be a part of squares (0,0); (1,0); (0,1); and (1,1).

If our player happened to click directly on that pixel, we'ld have to jump through some significantly complicated hoops to try to determine which square had actually been clicked. ... Messy! ... Very Messy!!

Instead, my "Upper-Left" Convention simply declares that that particular pixel belongs to square (1,1); and only to square (1,1).

Now consider this:


Square Map 10x10 Single Line Upper


Here, the horizontal blue line touches both square (1,0) and square (1,1). In accordance with my "Upper-Left" Convention, the line belongs to square (1,1); and only to square (1,1).

And, similarly, consider this:


Square Map 10x10 Single Line Left


Here, the vertical blue line touches both square (0,1) and square (1,1). In accordance with my "Upper-Left" Convention, the line belongs to square (1,1); and only to square (1,1).


For some additional clarification of all this, please continue to the Next Page.





                                                                                                                                                                M.D.J. 2022/08/17