jujubs
Member
Hi everyone. So I've been struggling with this for the last few hours, and after failing to find a solution elsewhere, I've decided to ask here: how do I check a collision with collision_line in other directions?
Cardinal directions are easy, because it uses a rectangle, but I can't find a way to do it at a 45 degree angle, for instance.
This is my code:
How exactly would I go about this?
I've read about lengthdir, but haven't found out how to actually implement it :/
Cardinal directions are easy, because it uses a rectangle, but I can't find a way to do it at a 45 degree angle, for instance.
This is my code:
Code:
if(collision_line(obj_player1.x+16,obj_player1.y-1,obj_player1.x+1000,obj_player1.y+1, obj_enemy, true, false))
{
instance_destroy();
}
I've read about lengthdir, but haven't found out how to actually implement it :/