weather and pause functionality implemented

This commit is contained in:
Melbyj1125
2022-03-02 12:56:22 -06:00
parent 00c3495461
commit 741dae95cd
6 changed files with 22 additions and 28 deletions

View File

@@ -42,7 +42,7 @@ public class dMoveSlideState : dMoveBaseState
}
//steadily increase traction
mSM.pStats.Traction += .004f;
mSM.pStats.CurTraction += .004f;
//If player isn't pressing either Q or the joystick button they stop sliding if nothing is above them
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){

View File

@@ -116,8 +116,10 @@ public class dMoveStateManager : NetworkBehaviour
//if (!IsLocalPlayer) { return; }
Cursor.lockState = CursorLockMode.Locked; // Lock cursor on start if you are the local player
pStats.Traction = pStats.CurTraction;
pStats.CurTraction = pStats.Traction;
pStats.CurAcc = pStats.Acc;
pStats.SetWeather(PlayerStats.Weather.Wind, new Vector3(1,0,0));
}
// Update is called once per frame
@@ -309,7 +311,7 @@ public class dMoveStateManager : NetworkBehaviour
//Apply Wind movement to the player
public void ApplyWind(bool wind){
if(wind){
moveController.Move(pStats.WindDirection.normalized * 2);
moveController.Move(pStats.WindDirection.normalized * .2f);
}
}
////

View File

@@ -42,7 +42,7 @@ public class MoveSlideState : MoveBaseState
}
//steadily increase traction
mSM.pStats.Traction += .004f;
mSM.pStats.CurTraction += .004f;
//If player isn't pressing either Q or the joystick button they stop sliding if nothing is above them
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){

View File

@@ -173,7 +173,8 @@ public class PlayerStats : MonoBehaviour
private float accModification;
//sets weather effect on player
public void SetWeather(Weather weather, Vector3 windDir){
public void SetWeather(Weather weather, Vector3 windDir = default(Vector3)){
switch(weather){
case Weather.Rain:{
Debug.Log("Rain");
@@ -181,9 +182,9 @@ public class PlayerStats : MonoBehaviour
tempTraction = traction;
tempAcc = acc;
traction -= 2;
if(curTraction - 2 > 0){
curTraction -= 2;
traction -= 4;
if(curTraction - 4 > 0){
curTraction -= 4;
}
acc += 2;
@@ -208,6 +209,8 @@ public class PlayerStats : MonoBehaviour
curAcc *= .5f;
accModification = -acc;
curVel *= .5f;
break;
}
@@ -257,7 +260,7 @@ public class PlayerStats : MonoBehaviour
Debug.Assert((maxVel >= 0), "maxVel cannot be below zero");
Debug.Assert((minVel >= 0), "minVel cannot be below zero");
Debug.Assert((curVel >= 0), "curVel cannot be below zero");
Debug.Assert((jumpPow >= 0), "jumpPow cannot be below zero");
Debug.Assert((jumpPow >= 0), "jumpPow cannot be below zero");
Debug.Assert((jumpNum >= 2), "jumpNum cannot be below 2");
Debug.Assert((traction >= 0), "traction cannot be below zero");
Debug.Assert((kickPow >= 0), "Playerpoints cannot be below zero");