B
Bengs
Guest
Hello everybody i created a attack system but whenever i hit a enemy or the other way arround it is a one hit kill even though my set dmg isnt equal to its health (in my creation code the Cdmg = 0 and Ehp is set to 100 in my enemies create script)
My attack code is :
My collission code is
My attack code is :
Code:
else if ((attack = 1))
{
hsp = 1;
x = x - hsp;
image_speed = 2;
sprite_index = Spr_CharacterAttack01Left;
if (place_meeting(x-1,y,par_enemy)){
Cdmg = 25;
}
if (image_index > image_number - 1){
attack = 0;
Cdmg=0;
}
Code:
with other{
Ehp -= Obj_Character.Cdmg
}