E
Eugene Yap Yew Juen
Guest
Hi everyone, I'm new here, I would like to ask if anyone have this problem before and know how to fix it?
I'm trying to create a hitbox shows between the sprite animation, but hitbox only appear when I'm pressing attack key. I expect when I "pressed" the attack key once and the hitbox will stay until the animation is ended.
(Sorry for my bad English, please tell me if anyone don't get it)
//Attack animation
sprite_index = sSlash;
//Hitbox
if(image_index >= 1) && (image_index <= 3){
with(instance_create_layer(x,y,"Attack",oHitbox)) {
image_xscale = other.image_xscale;
with(instance_place(x,y,oEnemy)) {
hp -= 3;
vsp -= 3;
hsp = sign(x - other.x) * 4;
flash = 3;
image_xscale = sign(hsp);
}
}
}
I'm trying to create a hitbox shows between the sprite animation, but hitbox only appear when I'm pressing attack key. I expect when I "pressed" the attack key once and the hitbox will stay until the animation is ended.
(Sorry for my bad English, please tell me if anyone don't get it)
//Attack animation
sprite_index = sSlash;
//Hitbox
if(image_index >= 1) && (image_index <= 3){
with(instance_create_layer(x,y,"Attack",oHitbox)) {
image_xscale = other.image_xscale;
with(instance_place(x,y,oEnemy)) {
hp -= 3;
vsp -= 3;
hsp = sign(x - other.x) * 4;
flash = 3;
image_xscale = sign(hsp);
}
}
}