20 lines
509 B
Plaintext
20 lines
509 B
Plaintext
|
function c_selectunit(unitobject) {
|
||
|
unitobject.state = st_moving;
|
||
|
unitobject.drawstate = st_movingdraw;
|
||
|
unitobject.returnpos = new vec2(unitobject.pos.x, unitobject.pos.y);
|
||
|
var mov = 2//DONT
|
||
|
var i, j;
|
||
|
for (i=-mov; i<=mov; i++) {
|
||
|
for (j=-mov; j<=mov; j++) {
|
||
|
if abs(i)+abs(j) <= mov {
|
||
|
c_colortile(unitobject.pos.x+i, unitobject.pos.y+j, c_cyan);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function c_colortile(x, y, color) {
|
||
|
if !array_contains(global.map[x][y], color) {
|
||
|
array_push(global.map[x][y].overlays, color);
|
||
|
}
|
||
|
}
|