O Ilusionista
Captain 100K
hi guys.
I am modifying a damage all enemies script to add a flash by script, but there is something wrong.
I am trying to get the enemies X and Y(a) position to call a flash, but the flash always appears at the wrong position
here is the code:
when facing right, we can see its almost there (but the "a" position is wrong), but when facing left, the "x" position is wrong too:
What am I doing wrong?
I am modifying a damage all enemies script to add a flash by script, but there is something wrong.
I am trying to get the enemies X and Y(a) position to call a flash, but the flash always appears at the wrong position
here is the code:
void damage_all_enemies(int damage, int drop, void atk_type)
{
int iEntity;
void vEntity;
void self = getlocalvar("self");
int iMax = openborvariant("ent_max");
for(iEntity=0; iEntity<iMax; iEntity++)
{
vEntity = getentity(iEntity);
float x = getentityproperty(vEntity, "x");
float a = getentityproperty(vEntity, "a");
if(getentityproperty(vEntity, "type")==openborconstant("TYPE_enemy"))
{
void Spawn;
Spawn = spawn01("flash", x, a, 1);
changeentityproperty(Spawn, "direction", 1);
damageentity(vEntity,self,damage,drop,openborconstant(atk_type));
}
}
}
when facing right, we can see its almost there (but the "a" position is wrong), but when facing left, the "x" position is wrong too:
What am I doing wrong?