Divinik
Member
So I have a variable (shots_fired) that counts how many time a gun is fired, but for some reason it will continuously add to the variable, even with a condition check:
It will add into the variable until the animation stops. Any ideas why this might be happening? the code is part of script in the step event of all actor's active in battle mode.
Code:
if parent.image_index >= 1
{
image_angle = 10;
x = parent.bbox_left+((parent.bbox_right-parent.bbox_left))*0.93;
y = parent.bbox_top+((parent.bbox_bottom-parent.bbox_top))*0.19;
if take_shot = true
{
shots_fired++;
take_shot = false;
}
}