something like enemy ai

This commit is contained in:
the me 2022-08-18 18:47:44 -07:00
parent f52e476acf
commit 0b371ac22d
8 changed files with 102 additions and 38 deletions

View file

@ -0,0 +1,27 @@
function c_passableeval() {
/*var i, j;
for (i=0; i<array_length(global.map); i++) {
for (i=0; i<array_length(global.map[i]); i++) {
global.map[i][j].passable
}
}
for (i=0; i<array_length(global.map); i++) {
for (i=0; i<array_length(global.map[i]); i++) {
if c_containsunit(global.map[i][j]) {
global.map[i][j].passable
}
}
}*/
}
function c_containsunit(x, y) {
var tile = c_gettile(x, y);
for (i=0; i<array_length(tile.contents); i++) {
if instance_exists(tile.contents[i]) {
if tile.contents[i].object_index = o_unit {
return tile.contents[i];
}
}
}
return false;
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "Scripts",
"path": "folders/Scripts.yy",
},
"resourceVersion": "1.0",
"name": "c_passableeval",
"tags": [],
"resourceType": "GMScript",
}