Example #1
0
 private void Start()
 {
     shake                  = GetComponent <CameraShake>();
     playerHealth           = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealth>();
     playerHealthUI         = playerHealth.GetComponent <PlayerHealthUI>();
     playerHealth.onDamage += CallShake;
 }
Example #2
0
    void Start()
    {
        currentHealth = startHealth;
        rb2D          = GetComponent <Rigidbody2D>();

        playerHealthUI = GameObject.FindGameObjectWithTag("HealthUI").GetComponent <PlayerHealthUI>();
        spriteRenderer = transform.Find("Sprite").GetComponent <SpriteRenderer>();
        startColor     = spriteRenderer.color;
    }
 public void Start()
 {
     healthUI    = GetComponent <PlayerHealthUI>();
     enemies     = FindObjectsOfType <EnemyState>().ToList();
     enemies2    = FindObjectsOfType <EnemyState2>().ToList();
     currentAmmo = maxAmmo;
     LoadSpaceShift(player[0]);
     isShifted     = false;
     isFacingRight = true;
 }
Example #4
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Example #5
0
    public void DetermineDisplay(PlayerHealthUI pHealthUI, int curHealth)
    {
        if (pHealthUI == null)
        {
            return;
        }
        if (curHealth <= -1 && spriteStart == deathStart)
        {
            return;                     //Ensure that messages are not spammed when there is no more health to go
        }

        CheckHealth(curHealth);
    }
Example #6
0
    private void Start()
    {
        rigidBody          = GetComponent <Rigidbody>();
        animator           = GetComponent <Animator>();
        playerHealthScript = GameObject.Find("Heart Storage").GetComponent <PlayerHealthUI>();

        // Initialize speed
        maxSpeed = 4.0f;
        movement = new PlayerMovement(maxSpeed);

        // Initialize health
        maxHealth = 3.0f;
        health    = maxHealth;
        playerHealthScript.UpdateHealth();
    }
	void Start() {
		playerHealthUI = GetComponent<PlayerHealthUI>();
		PlayerReference.RefreshPlayersUI();
	}
Example #8
0
    // called when the player dies. should reset the level once the level system is implemented.

    private void Start()
    {
        playerHealthUI = GameObject.Find("PlayerHealthUI").GetComponent <PlayerHealthUI>();
        player         = GameObject.FindGameObjectWithTag("Player");
    }