M
Marko Kajtazi
Guest
Hello everyone,
I have a problem with the collision_circle function. I want to have 2 variables with 2 different enemy objects, but when I do that, it detects the same enemy object.
Here is my code:
How can I set it to a different enemy object? Can anyone help me?
Thanks!!
I have a problem with the collision_circle function. I want to have 2 variables with 2 different enemy objects, but when I do that, it detects the same enemy object.
Here is my code:
Code:
first_enemy = collision_circle(x, y, 192, oEnemys, true, true);
second_enemy = collision_circle(x, y, 192, oEnemys, true, true);
if((!first_enemy == 0)) {
if(first_enemy.x < x) {
left_target = first_enemy;
}
if(first_enemy.x > x) {
right_target = first_enemy;
}
}
if((!second_enemy == 0)) {
if(second_enemy.x < x) {
left_target = second_enemy;
}
if(second_enemy.x > x) {
right_target = second_enemy;
}
}
Thanks!!