2022-08-15 10:51:51 -07:00
|
|
|
function c_gettile(x, y, absolute=false) {
|
2022-08-15 18:01:09 -07:00
|
|
|
if absolute {
|
|
|
|
var thex = round((x-16)/ts.x);
|
|
|
|
var they = round((y-16)/ts.y);
|
|
|
|
} else {
|
|
|
|
var thex = x;
|
|
|
|
var they = y;
|
|
|
|
}
|
2022-08-14 21:36:37 -07:00
|
|
|
if c_tileexists(thex, they) return mp[thex][they];
|
|
|
|
return noone;
|
|
|
|
}
|
|
|
|
|
|
|
|
function c_tileexists(posx, posy) {
|
|
|
|
if posx < array_length(mp) && posx >= 0 {
|
|
|
|
if posy < array_length(mp[posx]) && posy >= 0 {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|