Exemplo n.º 1
0
    void StartBlink()
    {
        turbinaEsq.StartBlink();
        turbinaDir.StartBlink();

        ship.StartBlink();
    }
Exemplo n.º 2
0
    private void actualizaWarning()
    {
        // Test parpadeo de minimapa
        //Zona zona = (Zona)currentTarget;
        Vector2 position = Direction(currentTarget);

        blinkWarning.StopBlink(false);
        blinkWarning.StartBlink(position.x, position.y);
    }
Exemplo n.º 3
0
    // Update is called once per frame
    private void Update()
    {
        float h = Input.GetAxis("Horizontal");

        if (h >= 0.1f)
        {
            transform.localScale = Vector3.one;
        }
        else if (h <= -0.1f)
        {
            transform.localScale = new Vector3(-1f, 1f, 1f);
        }


        isGrounded = Physics2D.OverlapCircle(groundCheck.position, 0.1f, groundLayer);
        UpdateSpeedMultiplier();

        if (Input.GetAxis("Horizontal") != 0f)
        {
            Move();
        }
        if ((Input.GetButtonDown("Jump") || Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) &&
            isGrounded)
        {
            Jump();
        }

        if (Input.GetMouseButtonDown(0) && canAttack &&
            !isAttacking && !isDefending)
        {
            canAttack = false;
            EnableAttack(true);
            Invoke("StopAttack", attackDuration);
            Invoke("ResetCanAttack", attackCooldown);
            soundManager.PlaySFX(SoundManager.SFXType.PLAYER_ATTACK, 0.5f);
        }
        else if (Input.GetMouseButtonDown(1) && !isAttacking && !isDefending)
        {
            EnableDefense(true);
        }
        if (Input.GetMouseButtonUp(1) && isDefending)
        {
            EnableDefense(false);
        }

        healthBar.size = health / maxHealth;

        if (blinking)
        {
            blink.StartBlink();
        }
        else
        {
            blink.StopBlink();
        }
    }
Exemplo n.º 4
0
    private void actualizaPlayerLocation()
    {
        // Test parpadeo de minimapa
        //Zona zona = (Zona)currentLocation;
        Vector2 position = Direction(currentLocation);

        blinkPlayer.StopBlink(false);
        blinkPlayer.StartBlink(position.x, position.y);
        blinkPlayer.StopBlink(true);
    }
Exemplo n.º 5
0
 // Update is called once per frame
 void Update()
 {
     if (blink != null)
     {
         if (canBeHit)
         {
             blink.StopBlink();
         }
         else
         {
             blink.StartBlink();
         }
     }
 }