diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-16 18:19:18 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-16 18:20:08 -0700 |
commit | 94f9bdf20df4d728b6f787a59812cb4448080347 (patch) | |
tree | de917749e4d4751e1d7376c2d9d843dc87bae00d /web/web_control.c | |
parent | 5a0ba5de6092493df4e8add82cca33135acc4da2 (diff) | |
download | dartboat-94f9bdf20df4d728b6f787a59812cb4448080347.tar.gz dartboat-94f9bdf20df4d728b6f787a59812cb4448080347.tar.xz |
web: add throw animation
Diffstat (limited to 'web/web_control.c')
-rw-r--r-- | web/web_control.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |