Web Wargaming

Web Wargaming Home
map

Range method

Now we can return the range

hexagon: 0000 to hexagon: 0000 has range of : 0

As the mouse moves, the hexagon number which is shown.

When you click on the mouse, the range method will be initialized.

Moving the mouse again will display the range

This example uses a 36 by 40 pixel scale.

View the source in your browser to look at the code

The code is easy:

if ( absX > absY ) {
range = absX / 2;
} else {
range = ( absX + absY ) / 4;
}

Range form

Copyright (c) 1998-2007 Mark Butler

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ;-)