//*-------------------------------------------------------------------------*// #region INTERFACE IMPLEMENTATION public void Enter_State(Godot.Collections.Dictionary <string, object> pParam) { _moveNode.Enter_State(pParam); _moveNode.MaxSpeed = _moveNode.MaxSpeed_Default; //_moveNode.Velocity = Utils.VECTOR_0; // not needed with the use of decceleration in Move.cs }
//*-------------------------------------------------------------------------*// #region INTERFACE IMPLEMENTATION public void Enter_State(Godot.Collections.Dictionary <string, object> pParam) { _moveNode.Enter_State(pParam); // Just after starting a straight jump, allow the character to move on x axis in the air // If 0.0f => the player jump, then cannot move on x axis until landing on the ground _moveNode.Acceleration.x = Acceleration_X; // To preserve the character inertia in the air if (pParam.ContainsKey("velocity")) { _moveNode.Velocity = (Vector2)pParam["velocity"]; // to override the default velocity _moveNode.MaxSpeed.x = Mathf.Max(Mathf.Abs(_moveNode.Velocity.x), _moveNode.MaxSpeed_Default.x); } // To make the player jump if (pParam.ContainsKey("impulse")) { //_moveNode.Velocity += Utils.CalculateJumpVelocity(_moveNode.Velocity, _moveNode.MaxSpeed, (float)pParam["impulse"]); _Movement_Jump(); } }
//*-------------------------------------------------------------------------*// #region INTERFACE IMPLEMENTATION public void Enter_State(Godot.Collections.Dictionary <string, object> pParam) { _moveNode.Enter_State(pParam); }