// Start is called before the first frame update void Start() { pc = GetComponent <PlatformingCharacter>(); // pc.OnJump += Pc_OnJump; // I dont think this contributes to a good playstyle, the fact taht being in air interupts recovery is quite good enough. pc.OnWallJump += Pc_OnWallJump; currentstamina = maxStamina; }
[ClientRpc(channel = 2)] private void RpcStomp(double time, Vector2 at) { if (time > lastBoost) { PlatformingCharacter.Resimulate((float)(NetworkTime.time - time), at, stomp: true); } }
void Start() { Character = GetComponent <PlatformingCharacter>(); Character.OnJump += PlatformingCharacter_OnJump; Character.OnStomp += (o) => PlatformingCharacter_OnJump(); // Health = GetComponent<Health>(); // Health.OnHurt += Health_OnHurt; // Health.OnKill += Health_OnKill; }
void Reset(PlatformingCharacter player) { if (next > Time.timeSinceLevelLoad) { return; } FindObjectOfType <PartyStreamer>().Pop(player.transform.position); player.transform.position = transform.position; next = Time.timeSinceLevelLoad + .1f; }
void Start() { Character = GetComponent <PlatformingCharacter>(); Character.OnJump += PlatformingCharacter_OnJump; Character.OnStomp += (o) => PlatformingCharacter_OnJump(); Character.OnWallJump += PlatformingCharacter_OnJump; GetComponent <DoubleJump>().OnDoubleJump += PlatformingAnimator_OnDoubleJump; // Health = GetComponent<Health>(); // Health.OnHurt += Health_OnHurt; // Health.OnKill += Health_OnKill; }
public void Respawn(PlatformingCharacter player) { if (player.GetComponent <NetworkIdentity>() == null) { Reset(player); } else if (player.GetComponent <NetworkIdentity>().isLocalPlayer) { Reset(player); } }
public void Stomp(PlatformingCharacter source) { hits++; StopCoroutine(Coroutine); if (hits >= 3) { Coroutine = StartCoroutine(KillMe()); } else { Coroutine = StartCoroutine(Routine(hits)); } }
IEnumerator Trigger(PlatformingCharacter player) { FindObjectOfType <Checkpoint>().Respawn(player); var camera = FindObjectOfType <CameraFollow>(); var renderer = player.GetComponentInChildren <SpriteRenderer>(); camera.enabled = false; player.enabled = false; renderer.enabled = false; yield return(new WaitForSeconds(.5f)); camera.enabled = true; renderer.enabled = true; player.enabled = true; }
IEnumerator DaLoop() { Controls = GetComponent <PlatformingCharacter>(); InputToken = new InputToken(); Controls.InputToken = InputToken; int direction = Controls.Forward; InputToken.Direction = new Vector2(direction, 0f); yield return(new WaitForSeconds(.1f)); GetComponent <SpriteRenderer>().enabled = true; Controls.enabled = true; Controls.HMomentum = 0f; Controls.VMomentum = 0f; GetComponentsInChildren <Collider2D>().ForEach(c => c.enabled = true); MoveForward: for (; ;) { InputToken.Direction = new Vector2(direction, 0f); if (Controls.TouchingWall && Controls.TouchingWallDirection == direction) { goto Turn; } if (turnAtLedges && Controls.Grounded && Controls.OnEdge) { goto Turn; } yield return(new WaitForFixedUpdate()); } Turn: direction = -direction; InputToken.Direction = new Vector2(direction, 0f); yield return(new WaitForSeconds(.1f)); goto MoveForward; }
private void PC_OnStomp(PlatformingCharacter obj) { denyFrames = 10; available = true; }
void Start() { PC = GetComponent <PlatformingCharacter>(); PC.OnStomp += PC_OnStomp; }
private void Start() { platformingCharacter = GetComponent <PlatformingCharacter>(); animator = GetComponent <Animator>(); }
private void PlatformingCharacter_OnStomp(PlatformingCharacter obj) { lastBoost = NetworkTime.time; obj.GetComponent <NetworkControls>().CmdStomp(NetworkTime.time, obj.transform.position); }