S
somebenishguy
Guest
currently working on my first ever game project. I am having trouble getting draw_sprite_ext to work. forgive me if I make any mistakes in the process of asking for help, I apologize, and will gladly supply any needed information.
anyway, the problem I'm having is that I am trying to implement a red flash when the player or an enemy takes damage. it works for the player, and one enemy, but the second enemy i've tried to add it to doesn't seem to work. the red flash displays the enemy's default sprite, even when the enemy is performing an animation. I had this problem with the other enemy originally, but I forget how I fixed it. any advice would be greatly appreciated, as I have been trying to fix this for hours before deciding to ask on the forums. here is the code for the draw tab in the nonfunctional and functional enemy respectively:
disfunctional:
draw_self();
//damage flash going right
if (flash > 0) && (hp > 0) && (hsp >= 0)
{
flash--;
if (image_index = sTwid)
{
draw_sprite_ext(sTwid,image_index,x,y,1,1,image_angle,c_red,1);
} else if (image_index = sTwidF)
{
draw_sprite_ext(sTwidF,image_index,x,y,1,1,image_angle,c_red,1);
} else if (image_index = sTwidF2)
{
draw_sprite_ext(sTwidF2,image_index,x,y,1,1,image_angle,c_red,1);
}
}
functional:
draw_self();
//damage flash going right
if (flash > 0) && (hp > 0) && (hsp >= 0)
{
flash--;
draw_sprite_ext(sStenchman,image_index,x,y,1,1,image_angle,c_red,1);
}
//damage flash going left
if (flash > 0) && (hp > 0) && (hsp < 0)
{
flash--;
draw_sprite_ext(sStenchman,image_index,x,y,-1,1,image_angle,c_red,1);
}
anyway, the problem I'm having is that I am trying to implement a red flash when the player or an enemy takes damage. it works for the player, and one enemy, but the second enemy i've tried to add it to doesn't seem to work. the red flash displays the enemy's default sprite, even when the enemy is performing an animation. I had this problem with the other enemy originally, but I forget how I fixed it. any advice would be greatly appreciated, as I have been trying to fix this for hours before deciding to ask on the forums. here is the code for the draw tab in the nonfunctional and functional enemy respectively:
disfunctional:
draw_self();
//damage flash going right
if (flash > 0) && (hp > 0) && (hsp >= 0)
{
flash--;
if (image_index = sTwid)
{
draw_sprite_ext(sTwid,image_index,x,y,1,1,image_angle,c_red,1);
} else if (image_index = sTwidF)
{
draw_sprite_ext(sTwidF,image_index,x,y,1,1,image_angle,c_red,1);
} else if (image_index = sTwidF2)
{
draw_sprite_ext(sTwidF2,image_index,x,y,1,1,image_angle,c_red,1);
}
}
functional:
draw_self();
//damage flash going right
if (flash > 0) && (hp > 0) && (hsp >= 0)
{
flash--;
draw_sprite_ext(sStenchman,image_index,x,y,1,1,image_angle,c_red,1);
}
//damage flash going left
if (flash > 0) && (hp > 0) && (hsp < 0)
{
flash--;
draw_sprite_ext(sStenchman,image_index,x,y,-1,1,image_angle,c_red,1);
}