aboutsummaryrefslogtreecommitdiff
path: root/test-client/visual.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-20 16:38:44 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:24:32 +0200
commit6eab355611872d9fd97d2bab16b85ea716787483 (patch)
tree81bdd82d9e68f2f6090b57470bdb5ea20198e333 /test-client/visual.ts
parent20556b7f754ff40860cc69bb3cd67b42581509a3 (diff)
downloadhurrycurry-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.ts6
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()