From 945a3f45adbf509ef5e7986d55121a4899e0a1b3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 19 Jun 2024 13:40:26 +0200 Subject: customer pathfinding --- test-client/main.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test-client/main.ts') diff --git a/test-client/main.ts b/test-client/main.ts index f208eb34..b189f08b 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -70,7 +70,7 @@ let data: Gamedata = { item_names: [], tile_names: [], spawn: [0, 0] } let my_id: PlayerID = -1 const camera: V2 = { x: 0, y: 0 } -const camera_zoom = 0.05 +let camera_zoom = 0.1 const interact_target_anim: V2 = { x: 0, y: 0 } let interacting: V2 | undefined; let scale = 0 @@ -327,6 +327,15 @@ function draw_ingame() { draw_interact_target() ctx.restore() + + if (keys_down.has("KeyP")) { + camera_zoom = 0.05 + ctx.fillStyle = "white" + ctx.textAlign = "left" + ctx.textBaseline = "bottom" + ctx.font = "20px sans-serif" + ctx.fillText(`interact = ${JSON.stringify(get_interact_target())}`, 10, 30) + } else { camera_zoom = 0.1 } } function draw_item(item: ItemData) { -- cgit v1.2.3-70-g09d2