D
DKR_87
Guest
I have 3 enemies in the room. When I kill one of them, they ALL die. In my bullet End Step event, I check a collision line for fast bullet collision. My goal, I presume, is to decrease the "hp" variable of the specific ID of the enemy object that the bullet is colliding with. I've done some searching and tried some ideas I came up with. No luck so far. Any help?
Bullet END STEP
Obviously, this code decreases ALL instances of obj_enemy by the player's damage. I've learned quite a bit in the last few years using GM Studio. Admittedly, working with object ID's has been the last confusing thing to me.
Thanks for any help,
Dustin
Bullet END STEP
Code:
if collision_line(xprevious,yprevious,x,y,obj_enemy,1,0)
{
instance_destroy();
// Decrease Enemy Health
obj_enemy.hp -= obj_player.damage;
}
Thanks for any help,
Dustin