diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-18 13:43:19 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-18 13:43:19 +0200 |
commit | 343bb6dff5ba6fca3d2bcfc55be7329ca38356bc (patch) | |
tree | adfa80c5567c84db906795764ab31a82bc9836cc /test-client/main.ts | |
parent | db88d9e67841a287cc869ec9dd412be97d94b956 (diff) | |
download | hurrycurry-343bb6dff5ba6fca3d2bcfc55be7329ca38356bc.tar hurrycurry-343bb6dff5ba6fca3d2bcfc55be7329ca38356bc.tar.bz2 hurrycurry-343bb6dff5ba6fca3d2bcfc55be7329ca38356bc.tar.zst |
particle fun
Diffstat (limited to 'test-client/main.ts')
-rw-r--r-- | test-client/main.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test-client/main.ts b/test-client/main.ts index de1424d3..b2deeca5 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -19,6 +19,7 @@ import { init_locale } from "./locale.ts"; import { MovementBase, collide_player_player, update_movement } from "./movement.ts"; +import { particle_splash, tick_particles } from "./particles.ts"; import { Gamedata, ItemIndex, ItemLocation, Message, MessageTimeout, PacketC, PacketS, PlayerID, TileIndex } from "./protocol.ts"; import { V2, lerp_exp_v2_mut, normalize, lerp_exp } from "./util.ts"; import { draw_ingame, draw_wait } from "./visual.ts"; @@ -289,6 +290,7 @@ function keyboard(ev: KeyboardEvent, down: boolean) { if (down && ev.code == "Numpad8") send({ player: my_id, type: "communicate", message: { text: "/start-tutorial plate:seared-patty,sliced-bun" } }) if (down && ev.code == "Numpad9") send({ player: my_id, type: "communicate", message: { text: "/start-tutorial plate:bun" } }) if (down && ev.code == "Numpad0") send({ player: my_id, type: "communicate", message: { text: "/end" } }) + if (down && ev.code == "KeyE") particle_splash(get_interact_target() ?? { x: 0, y: 0 }) if (down) keys_down.add(ev.code) else keys_down.delete(ev.code) } @@ -395,6 +397,8 @@ function frame_update(dt: number) { const zoom_target = Math.min(canvas.width, canvas.height) * (keys_down.has("KeyL") ? 0.05 : 0.1) camera_scale = lerp_exp(camera_scale, zoom_target, dt * 5) nametag_scale_anim = lerp_exp(nametag_scale_anim, +keys_down.has("KeyL"), dt * 10) + + tick_particles(dt) } function resize() { |