/// <summary> /// Gets scripts and components. /// </summary> private void Start() { _lives = GetComponent <Lives>(); sord = Instantiate(sord, transform.position, transform.rotation); sord.SetActive(false); _sordScript = sord.GetComponent <SwordScript>(); }
// Use this for initialization void Start() { rigid = GetComponent <Rigidbody2D>(); script = FindObjectOfType <Lives>(); MaxHealth = health; baseSpeed = speed; }
// Start is called before the first frame update void Start() { health = GetComponent <Lives>(); gameOver = GameObject.FindGameObjectWithTag("GameOverPanel"); //game over canvas is visible now gameOverCanvas = gameOver.GetComponent <Canvas>(); }
void OnTriggerEnter2D(Collider2D collider) { livesScript = FindObjectOfType<Lives>(); Destroy (collider.gameObject); livesScript.LoseLives(); }
void Start() { playerHealth = player.GetComponent <Health>(); loadScene = GetComponent <LoadScene>(); playerLives = GetComponent <Lives>(); bonfires = GetComponent <ResetLocations>(); }
// Start is called before the first frame update void Start() { //get a reference to the currency script attached to the manager GameObject manager = GameObject.Find("Manager"); Debug.Log("is manager null? " + manager.ToString()); currency = manager.GetComponent <Currency>(); Debug.Log("is currency script null? " + currency.ToString()); health = manager.GetComponent <Lives>(); //first time playing through if (!PlayerPrefs.HasKey("started")) { gameStartCanvas.SetActive(true); Time.timeScale = 0f; } else { gameStartCanvas.SetActive(false); } gameOverCanvas.SetActive(false); //set starting lives and currency health.lives = startingLives; currency.money = startingCurrency; }
void Start() { PaddletoBallVector = transform.position - paddle1.transform.position; myAudio = GetComponent <AudioSource>(); ballLaunch = GetComponent <Rigidbody2D>(); lives = FindObjectOfType <Lives>(); }
// Use this for initialization void Start() { life = this; lifeCount = startingLives; lifeText = GetComponent<Text> (); }
private void Start() { gameLevel = FindObjectOfType <GameLevel>(); lives = FindObjectOfType <Lives>(); ball = FindObjectOfType <Ball>(); scoreText.text = score.ToString(); }
private void OnTriggerEnter2D(Collider2D col) { //Detect collision of the player character with an enemy character, or with an enemy bullet if (((col.tag == "EnemyCharacterTag") || (col.tag == "EnemyBulletTag")) && !isImmune) { //Reset score multiplier on damaged ScoreMultiplier = 1; StartCoroutine("FlashCharacterOnDamage"); //Blink unit on damaged PlayExplosion(); //Create damaged or explosion effect Lives--; //player lose one Lives LiveUIText.text = Lives.ToString(); //Update the UI text Lives if (Lives <= 0) //If player is dead { StopAllCoroutines(); //Change game manager state to game over state GameManagerGO.GetComponent <GameManager>().SetGameManagerState(GameManager.GameManagerState.GameOver); //hide the player's character gameObject.SetActive(false); } } }
public void UpdateMyEnemyLivesText() { Lives myEnemyLives = myEnemy.GetComponent <Lives> (); myEnemyLives.livesText = myEnemyLivesText; myEnemyLives.updateText(); }
void Start() { anim = GetComponent <Animator>(); lives = GetComponent <Lives>(); lives.OnLostLife += PlayDestroyedAnimation; GameController.OnRespawn += PlayIdleAnimation; }
void Start() { //Get Components rig = GetComponent <Rigidbody2D>(); source = GetComponent <AudioSource>(); lives = GameObject.FindGameObjectWithTag("Collectibles").GetComponent <Lives>(); }
void Start() { aSource = GetComponent <AudioSource>(); pLives = GetComponent <Lives>(); pShooting = GetComponent <PlayerShooting>(); pLives.OnLostLife += PlayShipDestroyed; pShooting.OnShoot += PlayShot; }
void Awake() { instance = this; text = GetComponent <Text>(); text.text = lives.ToString(); }
void Start() { staticRef = this; if (infiniteLives) { InfiniteMark(); } }
private void Awake() { Cockpit = GameObject.Find("Cockpit"); Hit = gameObject.GetComponent <AudioSource>(); l = GetComponent <Lives>(); hitEffect = hitEffectObject.GetComponent <ParticleSystem>(); deathEffect = deathEffectObject.GetComponent <ParticleSystem>(); }
public OwnerProfile() { userProfile = new UserProfile(); facebookProfile = new FacebookProfile(); lives = new Lives(); level_data = new LevelData(); inbox = new Inbox(); }
private void OnHeroDefeat() { Lives.ChangeValue(-1); if (Lives.value > Lives.minValue) { onRespawn.Invoke(Hero); } }
// Start is called before the first frame update void Start() { playerPU = FindObjectOfType <PlayerPowerUps>(); lives = FindObjectOfType <Lives>(); FindObjectOfType <LevelManager>().enabled = false; SetUpMoveBoundaries(); PlayerPrefs.SetInt("LastScene", SceneManager.GetActiveScene().buildIndex); }
private void Start() { addScore = new AddScore(); sceneControl = GameObject.FindObjectOfType <SceneControl>(); lives = GameObject.FindObjectOfType <Lives>(); balls = GameObject.FindObjectsOfType <Ball>(); score = GameObject.FindObjectOfType <Score>(); }
// Use this for initialization void Start() { IsGrounded = true; rb2d = GetComponent <Rigidbody2D>(); a2d = GetComponent <Animator>(); sprite = GetComponent <SpriteRenderer>(); continues = GameObject.Find("AppManager").GetComponent <ContinueScript>(); lifeCounter = GameObject.Find("LiveHolder").GetComponent <Lives>(); }
public void OnTriggerEnter2D(Collider2D other) { if (vulnerable && other != null && other.CompareTag("Enemy")) { vulnerable = false; Lives.LoseLife(invincibilityTime * 0.33f); StartCoroutine(Invincible()); } }
void OnMouseOver() { if (Input.GetMouseButtonDown(0)) { Destroy(gameObject); Lives.HurtPlayer(pointsToDead); print("Red_Destroy"); } }
public override void Update(GameTime gameTime, InputHelper inputHelper) { Text = "Score: " + Score.ToString() + "\n\n"; Text += "Lives: " + Lives.ToString(); base.Update(gameTime, inputHelper); }
// Update is called once per frame void Update() { scoreDisplay.text = "" + score.ToString(); if (score < 0) { Lives.Die(); } }
private void Awake() { if (instance) { Destroy(instance); } instance = this; }
// Start is called before the first frame update void Start() { rigidBody = GetComponent <Rigidbody2D>(); boxCollider = GetComponent <BoxCollider2D>(); gunScript = gun.GetComponent <Gun>(); livesScript = FindObjectOfType <Lives>(); animator = GetComponent <Animator>(); hitSound = GetComponent <AudioSource>(); }
private void Revive() { Lives.SetValue(Lives.Value - 1); IsDead = false; ClearBags(); m_animator.SetBool("is_dead", value: false); m_animator.SetInteger("death_type", 1); GameLogic.OnPenguinRevive(); }
public override void Awake() { base.Awake(); if (lives == null) { lives = this; } Name = "Lives"; }
// Start is called before the first frame update void Start() { lives = Controller.GetComponent <Lives>(); FireTimer = 0; cam = Camera.main; height = 2f * cam.orthographicSize; width = height * cam.aspect; GetComponent <SpriteRenderer>().color = Color.blue; }
public void CallMove() { var Lives2 = Lives.ToList(); foreach (var life in Lives2) { life.Move(); } }
public void Start () { p=GetComponent<Player_Movement>(); rig=GetComponent<Rigidbody2D>(); camTrack = camera.GetComponent<Camera_Tracker> (); blocks = new List<GameObject> (); graves = new List<GameObject> (); heartsList = GameObject.Find ("LifeCounter").GetComponent<Lives> (); pillsList = GameObject.Find ("PillCounter").GetComponent<Lives> (); }
void Start() { lifescript = gameObject.AddComponent<Lives>(); //gameoverpanel.Init(); ms = gameObject.AddComponent<ModeSelect>(); if (ms.getMode() == 1) { mc = FindObjectOfType<Mechanic>(); } if (ms.getMode() == 2) { gmc = FindObjectOfType<GrannyMechanic>(); } charanimator = FindObjectOfType<CollisionPlayer>().gameObject.GetComponentInChildren<Animator>(); sfxm = FindObjectOfType<SFXManager>().GetComponent<SFXManager>(); audiom = FindObjectOfType<AudioRegulator>().gameObject; lives = 3; realTime = 0f; slowdown = false; badtrip = false; activeSlow = false; activeTrip = false; }
//private GameObject audioCollect; //private bool playGame; // private bool instructions; // Vector3 PlayerPos;//PlayerPos // Vector3 lastPlayerPos;//PlayerPos // public float playerSpeed_normal;//playerSpeed // Use this for initialization void Start() { //lastPlayerPos = transform.position; //yield return StartCoroutine (Shoots ()); //audioCollect = GameObject.Find ("SFX"); lifeScript = theLives.GetComponent<Lives> (); lifeScriptShadow = theLivesShadow.GetComponent<Lives> (); shootAnim = GetComponent<Animator> (); //instructions = true; //playGame = false; }
void Start() { ms = gameObject.AddComponent<ModeSelect>(); lifescript = gameObject.AddComponent<Lives>(); life1.sprite = lifesprite; life2.sprite = lifesprite; life3.sprite = lifesprite; previouslifes = lifescript.returnLives(); gameover = false; }
void Start () { hearts = GameObject.Find ("LifeCounter").GetComponent<Lives> (); pills = GameObject.Find ("PillCounter").GetComponent<Lives> (); p = GetComponent<Player_Movement> (); }
// Use this for initialization void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; isMobile = Application.isMobilePlatform; lives = (Lives)GameObject.FindGameObjectWithTag ("Lives").GetComponent<Lives>(); score = (Score)GameObject.FindGameObjectWithTag ("Score").GetComponent<Score> (); cameraFollower = (CameraFollower)GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<CameraFollower> (); Restart (); dot_count = GameObject.FindGameObjectsWithTag ("Dot").Length; }