aboutsummaryrefslogtreecommitdiff
path: root/test-client/protocol.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-19 00:08:13 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:21:22 +0200
commit203a4309a762488a4de72123e2f08f229e607e1a (patch)
tree752e7ffade32c6d66ee02725280c3041e25d6194 /test-client/protocol.ts
parentfe0dd480d6e93098cddc71d596a8d7e61fec68ed (diff)
downloadhurrycurry-203a4309a762488a4de72123e2f08f229e607e1a.tar
hurrycurry-203a4309a762488a4de72123e2f08f229e607e1a.tar.bz2
hurrycurry-203a4309a762488a4de72123e2f08f229e607e1a.tar.zst
character selection
Diffstat (limited to 'test-client/protocol.ts')
-rw-r--r--test-client/protocol.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index 98fcbf39..31f61d19 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -10,14 +10,14 @@ export interface Gamedata {
}
export type PacketS =
- { type: "join", name: string } // You join, sent as first packet.
+ { type: "join", name: string, character: number } // You join, sent as first packet.
| { type: "position", pos: Vec2, rot: number } // Update your position and rotation in radians (0 is -y)
| { type: "interact", pos: Vec2, edge: boolean } // Interact with some tile. edge is true when pressing and false when releasing interact button
| { type: "collide", player: PlayerID, force: Vec2 } // Apply force to another player as a result of a collision
export type PacketC =
{ type: "init", id: PlayerID, data: Gamedata } // You joined
- | { type: "add_player", id: PlayerID, name: string, item?: ItemIndex } // Somebody else joined (or was already in the game)
+ | { type: "add_player", id: PlayerID, name: string, item?: ItemIndex, position: Vec2, character: number } // Somebody else joined (or was already in the game)
| { type: "remove_player", id: PlayerID } // Somebody left
| { type: "position", player: PlayerID, pos: Vec2, rot: number } // Update the position of a players (your own position is included here)
| { type: "take_item", tile: Vec2, player: PlayerID } // An item was taken from a tile