aboutsummaryrefslogtreecommitdiff
path: root/test-client/main.ts
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2024-06-27 12:50:54 +0200
committernokoe <nokoe@mailbox.org>2024-06-27 12:50:54 +0200
commit0ad1882a7a9023abb164c84630c7cd6fbbeb746f (patch)
tree1224b58658fb98d10ae1be9efc78554160230128 /test-client/main.ts
parentb0363cf5b56837b74308d4335d7f189f843ea770 (diff)
parentec6377cb004ae564a8ad2fd895f8aad09b0153c6 (diff)
downloadhurrycurry-0ad1882a7a9023abb164c84630c7cd6fbbeb746f.tar
hurrycurry-0ad1882a7a9023abb164c84630c7cd6fbbeb746f.tar.bz2
hurrycurry-0ad1882a7a9023abb164c84630c7cd6fbbeb746f.tar.zst
Merge branch 'master' of ssh://codeberg.org/metamuffin/undercooked
Diffstat (limited to 'test-client/main.ts')
-rw-r--r--test-client/main.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/test-client/main.ts b/test-client/main.ts
index b0b492ce..4d1e9c53 100644
--- a/test-client/main.ts
+++ b/test-client/main.ts
@@ -19,7 +19,7 @@
import { MovementBase, update_movement } from "./movement.ts";
import { Gamedata, ItemIndex, Message, PacketC, PacketS, PlayerID, TileIndex } from "./protocol.ts";
-import { V2, add_v2, lerp_exp_v2_mut, normalize, lerp_exp, sub_v2, length } from "./util.ts";
+import { V2, add_v2, lerp_exp_v2_mut, normalize, lerp_exp } from "./util.ts";
import { draw_ingame, draw_wait } from "./visual.ts";
const KEY_INTERACT = "KeyJ"
@@ -139,9 +139,10 @@ function packet(p: PacketC) {
case "position": {
const pl = players.get(p.player)!
const pos = { x: p.pos[0], y: p.pos[1] }
- const dist = length(sub_v2(pl.position, pos));
+ // const dist = length(sub_v2(pl.position, pos));a
// TODO this is actually not a good idea if latency is too high
- if (p.player == my_id && dist < 3) return; // we know better where we are
+ // if (p.player == my_id && dist < 3) return; // we know better where we are
+ if (p.player == my_id) return
pl.position.x = pos.x
pl.position.y = pos.y
pl.rot = p.rot