range marking
This commit is contained in:
parent
d8e6a82fdb
commit
26eabf966d
58 changed files with 774 additions and 76 deletions
|
@ -36,4 +36,17 @@ function c_colortile(x, y, color) {
|
|||
array_push(global.map[x][y].overlays, color);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function c_markunit(unitobject) {
|
||||
var i, j;
|
||||
var mov = unitobject.data.mov.val;
|
||||
for (i=-mov; i<=mov; i++) {
|
||||
for (j=-mov; j<=mov; j++) {
|
||||
if abs(i)+abs(j) <= mov {
|
||||
(unitobject.marked ? c_decolor : c_colortile)(unitobject.pos.x+i, unitobject.pos.y+j, c_maroon);
|
||||
}
|
||||
}
|
||||
}
|
||||
unitobject.marked = !unitobject.marked;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue