diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-20 16:38:44 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:24:32 +0200 |
commit | 6eab355611872d9fd97d2bab16b85ea716787483 (patch) | |
tree | 81bdd82d9e68f2f6090b57470bdb5ea20198e333 /test-client/visual.ts | |
parent | 20556b7f754ff40860cc69bb3cd67b42581509a3 (diff) | |
download | hurrycurry-6eab355611872d9fd97d2bab16b85ea716787483.tar hurrycurry-6eab355611872d9fd97d2bab16b85ea716787483.tar.bz2 hurrycurry-6eab355611872d9fd97d2bab16b85ea716787483.tar.zst |
grey cursor when no interaction possible
Diffstat (limited to 'test-client/visual.ts')
-rw-r--r-- | test-client/visual.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test-client/visual.ts b/test-client/visual.ts index 37ae732d..4d7468eb 100644 --- a/test-client/visual.ts +++ b/test-client/visual.ts @@ -1,4 +1,4 @@ -import { ItemData, PLAYER_SIZE, camera, canvas, ctx, data, get_interact_target, interact_target_anim, items_removed, keys_down, players, tiles } from "./main.ts"; +import { ItemData, PLAYER_SIZE, camera, canvas, ctx, data, get_interact_target, interact_possible_anim, interact_target_anim, items_removed, keys_down, players, tiles } from "./main.ts"; import { Message } from "./protocol.ts"; import { FALLBACK_TILE, ITEMS, TILES, FALLBACK_ITEM } from "./tiles.ts"; import { V2, ceil_v2, floor_v2 } from "./util.ts"; @@ -103,8 +103,8 @@ function draw_interact_target() { ctx.lineCap = "round" ctx.lineJoin = "round" - ctx.lineWidth = 0.06 + 0.03 * Math.sin(Date.now() / 100) - ctx.strokeStyle = "rgb(84, 122, 236)" + ctx.lineWidth = 0.06 + 0.03 * Math.sin(Date.now() / 100) * interact_possible_anim + ctx.strokeStyle = `hsla(225, ${interact_possible_anim * 100}%, 62.70%, ${interact_possible_anim * 0.7 + 0.3})` ctx.strokeRect(0, 0, 1, 1) ctx.restore() |