Tobey
Member
I am currently creating void (areas the player can fall into) collisions for my top down game. The void is defined with tiles and a specific tile layer and I want to check to see if the players entire collision mask is inside of the void tiles similar to the rectangle_in_rectangle() function.
This is the code I have right now:
This is the code I have right now:
GML:
///@arg tilemap
var _tilemap, _meeting;
_tilemap = argument0;
//check for collision on all four corners of the collision mask
_meeting = tilemap_get_at_pixel(_tilemap, bbox_right, bbox_top)
or
tilemap_get_at_pixel(_tilemap, bbox_right, bbox_bottom)
or
tilemap_get_at_pixel(_tilemap, bbox_left, bbox_top)
or
tilemap_get_at_pixel(_tilemap, bbox_left, bbox_bottom);
//Return wether or not there was a collision
return(_meeting);