RedWarriorKTF
Member
Hi everyone, I've got a bit stuck on an issue. I have my music change when in a certain radius of an enemy. However it only seems to work on the first instance of the enemy that was created. Any idea why it only works on one enemy?
Big thankyou in advance for any help.
EDIT: Also worth pointing out if I kill the first enemy created the code does work on the second created.
Here's my code...
Big thankyou in advance for any help.
EDIT: Also worth pointing out if I kill the first enemy created the code does work on the second created.
Here's my code...
if (instance_exists(oEnemyArcher))
{
if (point_in_circle(oEnemyArcher.x,oEnemyArcher.y,x,y,300))
{
message += "I see you";
with (oMusic)
{
audio_sound_gain(mBattle,1,2000)
audio_sound_gain(mNormal,0,2000)
}
}
if (!point_in_circle(oEnemyArcher.x,oEnemyArcher.y,x,y,300))
{
message += "I dont see you";
with (oMusic)
{
audio_sound_gain(mBattle,0,2000)
audio_sound_gain(mNormal,1,2000)
}
}
}
Last edited: