mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
-Modified mountain (may need more changes later)
-Added full controller support for all abillities that will be in the game (grapple is currently set to x)
This commit is contained in:
@@ -34,7 +34,8 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
{
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.E)) //If grapple button is hit
|
||||
//if E or left face gamepad button is pressed is slightly pressed
|
||||
if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) //If grapple button is hit
|
||||
{
|
||||
if (!isGrappled) //If we are not grappling
|
||||
{
|
||||
@@ -60,7 +61,8 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
{
|
||||
Debug.DrawRay(gameObject.transform.position, (hookPoint.transform.position - gameObject.transform.position)); //Visual of line
|
||||
|
||||
if (Input.GetKey(KeyCode.LeftShift)) //Extend hook
|
||||
//if left shift or left bumper held down
|
||||
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.JoystickButton4)) //Extend hook
|
||||
{
|
||||
ropeLength += climbRate * Time.deltaTime;
|
||||
if (ropeLength > maxGrappleDistance)
|
||||
@@ -69,7 +71,7 @@ public class dGrapplingHook : NetworkBehaviour
|
||||
}
|
||||
//Debug.Log(ropeLength.ToString());
|
||||
}
|
||||
if (Input.GetKey(KeyCode.RightShift)) // Retract Hook
|
||||
if (Input.GetKey(KeyCode.RightShift) || Input.GetKey(KeyCode.JoystickButton5)) // Retract Hook
|
||||
{
|
||||
ropeLength -= climbRate * Time.deltaTime;
|
||||
if (ropeLength < 5)
|
||||
|
||||
@@ -30,7 +30,8 @@ public class dKickController : NetworkBehaviour
|
||||
void Kick(){
|
||||
//Note: when we merge this into PlayerMovement, we may want to change isgrounded to our
|
||||
//custom is grounded
|
||||
if (Input.GetKeyDown(KeyCode.F) && isKicking == false && characterController.isGrounded == false)
|
||||
//If F is pressed or gamepad right trigger is pulled
|
||||
if ((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && isKicking == false && characterController.isGrounded == false)
|
||||
{
|
||||
Debug.Log("dive");
|
||||
// if kicking in air, kick until grounded (maybe add some foward momentum if needeD)
|
||||
@@ -39,13 +40,14 @@ public class dKickController : NetworkBehaviour
|
||||
leg.SetActive(true);
|
||||
}
|
||||
//otherwise do ground kick for .3 seconds
|
||||
else if (Input.GetKeyDown(KeyCode.F) && isKicking == false){
|
||||
else if ((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && isKicking == false){
|
||||
Debug.Log("kick");
|
||||
StartCoroutine(Kicking(.3f));
|
||||
}
|
||||
|
||||
//once dive kick touches ground, set back to normal state
|
||||
if(characterController.isGrounded == true && isDiveKicking == true){
|
||||
if (characterController.isGrounded == true && isDiveKicking == true)
|
||||
{
|
||||
isDiveKicking = false;
|
||||
isKicking = false;
|
||||
leg.SetActive(false);
|
||||
|
||||
Reference in New Issue
Block a user