diff --git a/CharacterController.cs b/CharacterController.cs index 3e3fdeb..5c624c6 100644 --- a/CharacterController.cs +++ b/CharacterController.cs @@ -4,9 +4,20 @@ using System; using System.Text.Json.Serialization; +/// +/// Handles local player movement and basic player node initialization. +/// Movement is applied only when this node is the multiplayer authority. +/// public partial class CharacterController : CharacterBody2D { + /// + /// Horizontal movement speed. + /// public const float Speed = 300.0f; + + /// + /// Upward impulse used for jump. + /// public const float JumpVelocity = -400.0f; public PlayerInfo Info; @@ -14,31 +25,24 @@ public partial class CharacterController : CharacterBody2D // Get the gravity from the project settings to be synced with RigidBody nodes. public float gravity = ProjectSettings.GetSetting("physics/2d/default_gravity").AsSingle(); - public override void _Ready() - { - base._Ready(); - NakamaClient.Client.PlayerDataSync += onPlayerDataSync; - } + public override void _Ready() + { + base._Ready(); + } + /// + /// Sets the player's visible name and initial spawn position. + /// + /// Player display identifier. + /// Spawn world position. public void SetupPlayer(string name, Vector2 position){ GlobalPosition = position; GetNode