Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Manually typed out the first script and decided to post here so others don't have to

///@descrition tile_meeting(x,y,layer)
///@param x
///@param y
///@param layer
var _layer = argument[2],
_tm = layer_tilemap_get_id(_layer);

if (_tm == -1 || layer_get_element_type(_tm) != layerelementtype_tilemap) {
show_debug_message("Checking collision for non existent layer / tilemap")
return false;
}

var _x1 = tilemap_get_cell_x_at_pixel(_tm, bbox_left + (argument[0]-x),y ),
_y1 = tilemap_get_cell_y_at_pixel(_tm, x,bbox_top + (argument[1]-y) ),
_x2 = tilemap_get_cell_x_at_pixel(_tm, bbox_right + (argument[0] - x),y ),
_y2 = tilemap_get_cell_y_at_pixel(_tm, x, bbox_bottom + (argument[1]-y) );

for(var _x = _x1; _x <= _x2; _x++){
for(var _y = _y1; _y <= _y2; _y++) {
if (tilemap_get(_tm,_x,_y)) {
return true;
}
}
}

return false;

Thanks but if you click the image it will take you to PasteBin to get the source code as well.

(+1)

ty so much. PasteBin hasnt loaded for me at all.