wtf it works

This commit is contained in:
the me 2022-08-16 15:39:22 -07:00
parent 641ccd1065
commit aa747e8305
9 changed files with 48 additions and 14 deletions

View file

@ -25,4 +25,19 @@ if select && selectedunit == noone {
}
//draw_text(global.gw-10, global.gh-10-i*20;
}
}
var mousex = floor(mouse_x/global.tilesize.x);
var mousey = floor(mouse_y/global.tilesize.y);
//log(mousex, mousey);
hoveredunit = selectedunit;
if mousex < array_length(global.map) {
if mousey < array_length(global.map[mousex]) {
var i;
for (i=0; i<array_length(global.map[mousex][mousey].contents); i++) {
if global.map[mousex][mousey].contents[i].object_index == o_unit {
hoveredunit = (global.map[mousex][mousey].contents[i]);
}
}
}
}