F
FunkyB
Guest
Hello, I have a dumb question. There are three objects involved: the player, the enemy, and the enemy's bullet.
The idea is that the player, when a Collision Event occurs with the enemy's bullet, redirects that bullet back at the enemy. To show the user that this is occurring, I used effect_create_above( ef_ring... ).
My problem is that I only want one ef_ring to appear per bullet. Because the enemy's bullet and the player overlap, the collision event triggers repeatedly.
In an attempt to fix this, I created a variable, show_effect. Here is the code.
obj_player
Collision Event with obj_enemy_bullet
if( show_effect )
{
effect_create_above( ef_ring, other.x, other.y, 1, c_gray );
show_effect = false;
}
By setting show_effect to false, only one ring appears (which is what I want). However, many more bullets are on their way. I have just turned show_effect to false. As a result, no more ef_rings will occur (which is what I don't want).
Where can I set show_effect to true? How can I get one ef_ring per enemy bullet? Please don't shake your head too hard at me : ) Thanks for reading.
The idea is that the player, when a Collision Event occurs with the enemy's bullet, redirects that bullet back at the enemy. To show the user that this is occurring, I used effect_create_above( ef_ring... ).
My problem is that I only want one ef_ring to appear per bullet. Because the enemy's bullet and the player overlap, the collision event triggers repeatedly.
In an attempt to fix this, I created a variable, show_effect. Here is the code.
obj_player
Collision Event with obj_enemy_bullet
if( show_effect )
{
effect_create_above( ef_ring, other.x, other.y, 1, c_gray );
show_effect = false;
}
By setting show_effect to false, only one ring appears (which is what I want). However, many more bullets are on their way. I have just turned show_effect to false. As a result, no more ef_rings will occur (which is what I don't want).
Where can I set show_effect to true? How can I get one ef_ring per enemy bullet? Please don't shake your head too hard at me : ) Thanks for reading.