aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_time.c')
-rw-r--r--src/ft_time.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ft_time.c b/src/ft_time.c
index fb0b0d2..d175bbf 100644
--- a/src/ft_time.c
+++ b/src/ft_time.c
@@ -38,9 +38,32 @@ void
}
void
+ ft_bad_boys_time(clock_t before, t_cub *cl)
+{
+ int8_t i;
+ static clock_t dt = 0;
+ clock_t curr;
+
+ curr = clock();
+ dt += curr - before;
+ i = 0;
+ while (i < cl->mlist.sprite_nbr[13])
+ {
+ if (cl->bad_boy[i].sleep == 1 && dt > 0 && ft_clock_to_ms(dt) > 600.0)
+ {
+ cl->bad_boy[i].sleep = 0;
+ dt = 0;
+ }
+ i++;
+ }
+}
+
+void
ft_timings(clock_t before, t_cub *cl)
{
if (cl->plist.fire == 1)
ft_handle_firing(before, cl);
+ if (cl->mlist.sprite_nbr[13] > 0)
+ ft_bad_boys_time(before, cl);
ft_get_fps_count(before, cl);
}