diff options
author | metamuffin <metamuffin@disroot.org> | 2024-08-11 01:30:59 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-08-11 01:35:05 +0200 |
commit | 218da36b4f963a5dfcd619d543cb95c5c196d214 (patch) | |
tree | 244ecd10f4ca3d9798cedf7149394a1d4827b5d9 /test-client/main.ts | |
parent | f753629acd906ff7acd42a18a266cc93a883330c (diff) | |
download | hurrycurry-218da36b4f963a5dfcd619d543cb95c5c196d214.tar hurrycurry-218da36b4f963a5dfcd619d543cb95c5c196d214.tar.bz2 hurrycurry-218da36b4f963a5dfcd619d543cb95c5c196d214.tar.zst |
update movement in protocol and all clients
Diffstat (limited to 'test-client/main.ts')
-rw-r--r-- | test-client/main.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test-client/main.ts b/test-client/main.ts index f0f481b4..00699b60 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -156,7 +156,7 @@ function packet(p: PacketC) { case "remove_player": players.delete(p.id) break; - case "position": { + case "movement": { const pl = players.get(p.player)! const pos = { x: p.pos[0], y: p.pos[1] } // const dist = length(sub_v2(pl.position, pos));a @@ -165,7 +165,7 @@ function packet(p: PacketC) { if (p.player == my_id) return last_server_sent_position = pos pl.position.x = pos.x pl.position.y = pos.y - pl.boosting = p.boosting + pl.boosting = p.boost pl.rot = p.rot break; } @@ -307,7 +307,7 @@ function set_interact(edge: boolean) { function tick_update() { const p = players.get(my_id) if (!p) return - send({ player: my_id, type: "movement", pos: [p.position.x, p.position.y], direction: [p.direction.x, p.direction.y], boosting: p.boosting }) + send({ player: my_id, type: "movement", pos: [p.position.x, p.position.y], dir: [p.direction.x, p.direction.y], boost: p.boosting }) } function frame_update(dt: number) { |