This commit is contained in:
the me 2022-08-15 18:01:09 -07:00
parent 0ead044da1
commit 51cc3f3ca6
20 changed files with 278 additions and 33 deletions

View file

@ -42,48 +42,48 @@ function st_moving() {
c_decolor_all(c_red);
c_decolor_all(c_green);
var guy = c_gettile(x, y, true);
c_colortile(guy.x, guy.y, c_green);
//log("selecting");
var rng = [1];
var guy = c_gettile(x, y, true);
var hitting = noone;
if guy != noone {
c_colortile(guy.x, guy.y, c_green);
switch dir {
case DIR.LEFT:
c_colortile(guy.x-1, guy.y, c_red);
break;
case DIR.DOWN:
c_colortile(guy.x, guy.y+1, c_red);
break;
case DIR.UP:
c_colortile(guy.x, guy.y-1, c_red);
break;
case DIR.RIGHT:
c_colortile(guy.x+1, guy.y, c_red);
break;
}
}
if select {
var rng = [1];
var guy = c_gettile(x, y, true);
var hitting = noone;
switch dir {
case DIR.LEFT:
hitting = c_gettile(guy.x-1, guy.y);
c_colortile(guy.x-1, guy.y, c_red);
break;
case DIR.DOWN:
hitting = c_gettile(guy.x, guy.y+1);
c_colortile(guy.x, guy.y+1, c_red);
break;
case DIR.UP:
hitting = c_gettile(guy.x, guy.y-1);
c_colortile(guy.x, guy.y-1, c_red);
break;
case DIR.RIGHT:
hitting = c_gettile(guy.x+1, guy.y);
c_colortile(guy.x+1, guy.y, c_red);
break;
}
if hitting != noone {
if hitting != noone && select {
log("found one");
log(hitting.contents, hitting.x, hitting.y);
var i;
for (i=0; i<array_length(hitting.contents); i++) {
if instance_exists(hitting.contents[i]) {
log("is instance");
if hitting.contents[i].object_index = o_unit {
log("is unit");
log("found two");
c_generatecombatstack([id, hitting.contents[i]]);
}
}
}
}
}
if back {
state = st_standing;
drawstate = c_null;
c_deselectunit(id);
}
/*if x < (pos.x-mov)*ts.x {
x = (pos.x-mov)*ts.x;