void Start() { player = GameObject.Find("player"); playAct = player.GetComponent <playerActions> (); guiboss = transform.GetChild(0).GetComponent <GUIManager> (); Time.timeScale = 0f; }
void OnTriggerEnter(Collider other) { if (!paused) { if (InvadersGameData.directionChanged == false && other.tag == "Wall") { InvadersGameData.invadersDirection *= -1.0f; InvadersGameData.directionChanged = true; InvadersGameData.descendInvaders(); } else if (other.tag == "Laser") { InvadersGameData.notifyDecease(this.invaderID); ExplodeAndDestroy(); InvadersGameData.Score = InvadersGameData.Score + 1; InvadersGameData.remainingInvaders = InvadersGameData.remainingInvaders - 1; } else if (other.tag == "Player") { playerActions pa = other.GetComponent <playerActions>(); pa.ExplodeAndDestroy(); ExplodeAndDestroy(); } } }
// Use this for initialization void Start() { player = GameObject.Find("player"); rig = gameObject.GetComponent <Rigidbody2D> (); playerAct = player.GetComponent <playerActions> (); myName = transform.parent.GetChild(0).GetComponent <mobName> ().myName; anim = transform.GetChild(1).GetComponent <Animator> (); audioS = gameObject.GetComponent <AudioSource> (); maxSpeed = Mathf.Clamp(Random.Range(2f, 3f) + GameObject.Find("Mob spawner").GetComponent <mobSpawner> ().elapsedTime *(1f / 50f), 2f, 8f); }
// Use this for initialization void Start() { playerStatus = GameObject.FindGameObjectWithTag("Player"); playerAct = playerStatus.GetComponent <playerActions>(); catBody = this.GetComponent <Rigidbody>(); Debug.Log(playerStatus.name); rand = new System.Random(); rand.Next(); timeLimit = rand.Next(timeMin, timeMax); rotation = new Vector3(0, rand.Next(), 0); transform.Rotate(rotation); randomDir = this.transform.forward; effectDistLim = 30.0f; }
public void PlaySound(playerActions clip) { if (audioEffects != null) { switch (clip) { case playerActions.jump: audioEffects.PlayOneShot(playerJumpSound); break; case playerActions.die: audioEffects.PlayOneShot(playerDieSound); break; case playerActions.slide: audioEffects.PlayOneShot(playerSlideSound); break; } } }
void OnTriggerEnter(Collider other) { if (!paused) { if (other.tag == "WallDestroyer") { Destroy(gameObject); } else if (other.tag == "Player") { playerActions pa = other.GetComponent <playerActions>(); pa.ExplodeAndDestroy(); Destroy(gameObject); // Destruye el rocket } } }
void Start() { //Flag is false, default to regular platforming movement triggerTextboxMovement = false; controller = GetComponent <playerController> (); actions = GetComponent <playerActions> (); wallJumpTowards = new Vector2(12f, 20f); wallJumpAway = new Vector2(18f, 17f); wallJumpNeutral = new Vector2(8.5f, 7f); gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpvelocity = Mathf.Abs(gravity) * timeToJumpApex; //minJumpVelocity = Mathf.Sqrt (2 * Mathf.Abs (gravity) * minJumpHeight); //maxJumpvelocity = 16f; minJumpVelocity = 0.1f; }
// Use this for initialization void Start() { this.transform.gameObject.SetActive(false); playerStatus = GameObject.FindGameObjectWithTag("Player"); playerAct = playerStatus.GetComponent <playerActions>(); }
// Use this for initialization void Start() { playerInv = GameObject.Find("player").GetComponent <playerActions>(); }
private void selectPlayerAction() { switch (selectedItem) { case (0): playChangeAnimation("Change"); playerAction = playerActions.empty; break; case (1): if (isMushroomUsable) { playChangeAnimation("Change"); playerAction = playerActions.mushroom; } else selectedItem++; break; case (2): if(isPlantUsable) { playChangeAnimation("Change"); playerAction = playerActions.tendril; } else selectedItem++; break; case (3): if(isWaterplantUsable) { playChangeAnimation("Change"); playerAction = playerActions.waterplant; } else selectedItem++; break; } }