S
ShuDiZo
Guest
I'm having trouble with multiple collisions using perfect collisions. The problem that occurs with:
//Single collision but only performs the damage state once
var cc = collision_line(x, y, kx, ky, obj_elifeparent, false, true);
if (cc && can_hit == true){
cc.hp -=damage;
can_hit = false;
}
///Single collision but constantly distributes damage to the target
var cc = collision_line(x, y, kx, ky, obj_elifeparent, false, true);
if (cc){
cc.hp -=damage;
}
The problem i'm having is mostly the distribution of damage to objects via sprite mask (Non physic collision checking)
Can anyone please help/teach me how i could use arrays to save the id's of each object colliding with the line and also how i could distribute damage once. Thank you in advance.
//Single collision but only performs the damage state once
var cc = collision_line(x, y, kx, ky, obj_elifeparent, false, true);
if (cc && can_hit == true){
cc.hp -=damage;
can_hit = false;
}
///Single collision but constantly distributes damage to the target
var cc = collision_line(x, y, kx, ky, obj_elifeparent, false, true);
if (cc){
cc.hp -=damage;
}
The problem i'm having is mostly the distribution of damage to objects via sprite mask (Non physic collision checking)
Can anyone please help/teach me how i could use arrays to save the id's of each object colliding with the line and also how i could distribute damage once. Thank you in advance.
Last edited by a moderator: