Build Man
Member
So here, I have the feature of enemies standing (and walking) on destructible objects. I have made a code that hurts and defeats enemies when said objects are destroyed. The code looks like this:
And event_user(1) of Elder Ratteshell, whom I have taken as an example, looks like this:
They have a health of 10, so they are going to be beat anyway. The problem being, the former piece of code activates if it detects an enemy standing just by the single pixel of their collision mask, which looks like this:
What I want is for the code to activate not just by the single pixel, but only if an enemy in question stands on it by the half of it's collision mask or more. Please do not suggest change of collision masks themselves, they are used for multitude other behaviours.
GML:
var inst_break;
inst_break = instance_place(x, y-1, Elder_Rattleshell);
if (inst_break != noone)
{
with (inst_break) event_user(1);
}
Code:
sprite_index = Enemy_RattleElder_Damaged
vspeed = -9
hspeed = 0
enemy_health -= 20
What I want is for the code to activate not just by the single pixel, but only if an enemy in question stands on it by the half of it's collision mask or more. Please do not suggest change of collision masks themselves, they are used for multitude other behaviours.