From 94f9bdf20df4d728b6f787a59812cb4448080347 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 16 May 2022 18:19:18 -0700 Subject: web: add throw animation --- web/web_control.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'web/web_control.c') diff --git a/web/web_control.c b/web/web_control.c index b0dfd3b..0d8cd46 100644 --- a/web/web_control.c +++ b/web/web_control.c @@ -111,10 +111,14 @@ void boat_visit() struct ccoords c = v->ccoords[i]; + int delay = delay_ms * (i + 1); + if (delay_ms >= SVG_THROW_ANIM_MS) + delay -= SVG_THROW_ANIM_MS; + char *tmp = malloc(len_str + 1); // free in draw_boat_throwing memcpy(tmp, str, len_str + 1); EM_ASM({scheduleCCall($0, $1, $2, $3, $4, $5, $6)}, - "draw_boat_throwing", delay_ms * (i+1), + "draw_boat_throwing", delay, pts, tmp, c.x, c.y, curr_match_id); } -- cgit v1.2.3-70-g09d2