>>716113282doing this shit hundreds of times for 100+ animations is insanely fucking stupid.
if (sprite_index = spr_ATK_Swing){
var frame = floor(image_index);
if (frame == 5 && frame > prev_frame){ //frame has just ticked over
//play sound code
//add root_movement value
}
//hitboxes for frame 8
if (frame == 8){
//set_hitbox(x1,y1,x2,y2);
//set_hitbox(x1,y1,x2,y2);
//set_hitbox(x1,y1,x2,y2);
}
//hitboxes for frame 9
else if (frame == 9){
//set_hitbox(x1,y1,x2,y2);
//set_hitbox(x1,y1,x2,y2);
}
//hitboxes for frame 10
else if (frame == 10){
//set_hitbox(x1,y1,x2,y2);
//set_hitbox(x1,y1,x2,y2);
//set_hitbox(x1,y1,x2,y2);
//set_hitbox(x1,y1,x2,y2);
}
}
I should just put this data into an animation and have a system handle it. none of this hard coding is necessary.