void Flip(Poque otherPoque) { GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); otherPoque.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); var distance = transform.position - otherPoque.transform.position; otherPoque.transform.position = transform.position + distance; }
public void UnselectPoque() { if (m_selectedPoque != null) { m_selectedPoque.GetComponent <CharacterController>().ActivateSelectedFeedback(false); } m_selectedPoque = null; ShowAvailablePoques(); }
public void StartTurn() { m_isTurn = true; m_selectedPoque = null; foreach (var poque in m_poques) { poque.ResetTurn(); poque.GetComponent <CharacterController>().ActivateSelectionFeedback(true); } }
private void FollowPlayer() { Poque currentTarget = GameManager.m_instance.GetCurrentPlayer().m_selectedPoque; if (currentTarget != null) { float targetY = currentTarget.transform.position.y; Vector3 velocity = Vector3.zero;//F**K YOU UNITY Vector3 newCameraPosition = new Vector3(transform.position.x, targetY, transform.position.z); transform.position = Vector3.SmoothDamp(transform.position, newCameraPosition, ref velocity, followSmoothTime); float clampedY = Mathf.Clamp(transform.position.y, cameraMinY, cameraMaxY); transform.position = new Vector3(transform.position.x, clampedY, transform.position.z); } }
void ExecuteOnCollisionAbility(EClass poqueClasse, Poque otherPoque) { switch (poqueClasse) { case EClass.Archer: break; case EClass.Assassin: break; case EClass.Beefy: break; case EClass.DoubleDash: break; case EClass.Duplicating: break; case EClass.Fast: break; case EClass.Flipper: Flip(otherPoque); break; case EClass.Ghost: break; case EClass.Kamikaze: break; case EClass.Regular: break; case EClass.ShieldGuy: break; case EClass.Teleporter: break; case EClass.Valkyrie: break; case EClass.WindSupport: break; } }
void TrySelectPoque(Poque poque) { if (m_isTurn && poque.GetTeam() == m_team && (m_selectedPoque == null || !m_selectedPoque.GetIsLaunched())) { if (!poque.CanLaunch()) { return; } foreach (var otherPoque in m_poques) { otherPoque.GetComponent <CharacterController>().ActivateSelectionFeedback(false); otherPoque.GetComponent <CharacterController>().ActivateSelectedFeedback(false); } m_selectedPoque = poque; GameplayController.m_instance.AssignCharacterController(poque.GetComponent <CharacterController>()); m_selectedPoque.GetComponent <CharacterController>().ActivateSelectedFeedback(true); } }
public void ResetLaunch() { m_isTurn = true; m_selectedPoque = null; ShowAvailablePoques(); }
public void LaunchPoque(Poque poque) { LaunchedPoquesThisTurn++; }