From 2a09cbcca6ce29fbf6d837c5a220a0cbf1d6b70e Mon Sep 17 00:00:00 2001 From: tpart Date: Thu, 18 Jul 2024 15:58:35 +0200 Subject: Fix movement code in client to match new protocol; Bump protocol version to 2.0 --- client/multiplayer.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/multiplayer.gd') diff --git a/client/multiplayer.gd b/client/multiplayer.gd index d3e80613..d40c00d7 100644 --- a/client/multiplayer.gd +++ b/client/multiplayer.gd @@ -54,7 +54,7 @@ signal server_message(text: String) signal replay_start() signal connection_closed(reason: String) -const VERSION_MAJOR: int = 1 +const VERSION_MAJOR: int = 2 const VERSION_MINOR: int = 0 var connected := false @@ -264,11 +264,11 @@ func send_join(player_name: String, character: int): "character": character }) -func send_position(pos: Vector2, rotation: float, boosting: bool): +func send_movement(pos: Vector2, direction: Vector2, boosting: bool): send_packet({ - "type": "position", + "type": "movement", "pos": [pos.x, pos.y], - "rot": rotation, + "direction": [direction.x, direction.y], "boosting": boosting }) -- cgit v1.2.3-70-g09d2