Ejemplo n.º 1
0
    public void ToggleSpeed(bool?enableSpeedBoost = null)
    {
        if (Level != 2)
        {
            return;
        }

        const int speedBoost = 1;

        DizzyEffect.StartDoingTheDizzy();
        var playerController = pacman.GetComponent <PlayerController>();

        if ((enableSpeedBoost.HasValue && enableSpeedBoost.Value == false) || !enableSpeedBoost.HasValue && pacmanHasSpeedBoost)
        {
            if (pacmanHasSpeedBoost)
            {
                playerController.speed = playerController.speed -= speedBoost;
            }
            pacmanHasSpeedBoost = false;
            MoveInvertEffect.StopDoingTheEffect();
        }
        else
        {
            if (!pacmanHasSpeedBoost)
            {
                playerController.speed = playerController.speed += speedBoost;
            }
            pacmanHasSpeedBoost = true;
            MoveInvertEffect.StartDoingTheEffect();
        }
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (dizzinessGoing)
        {
            dizzinnessTimer += Time.deltaTime;
            Material.SetFloat("_OffsetMultiplier", Heaviness * Mathf.Sin(Mathf.PI * dizzinnessTimer / Duration));
            if (dizzinnessTimer > Duration)
            {
                dizzinessGoing  = false;
                dizzinnessTimer = 0f;
            }
        }

        if (Input.GetKeyDown(KeyCode.O))
        {
            DizzyEffect.StartDoingTheDizzy();
        }
    }
Ejemplo n.º 3
0
    public void InverseControls(bool?inversionEnabled = null)
    {
        DizzyEffect.StartDoingTheDizzy();
        var playerController = pacman.GetComponent <PlayerController>();

        if (inversionEnabled.HasValue)
        {
            playerController._isInversed = inversionEnabled.Value;
        }
        else
        {
            playerController._isInversed = !playerController._isInversed;
        }
        if (playerController._isInversed)
        {
            MoveInvertEffect.StartDoingTheEffect();
        }
        else
        {
            MoveInvertEffect.StopDoingTheEffect();
        }
    }
Ejemplo n.º 4
0
 private void Start()
 {
     instance = this;
 }
Ejemplo n.º 5
0
 override public void Invoke()
 {
     DizzyEffect.StartDoingTheDizzy();
 }