Exemplo n.º 1
0
    // Remove the powerup from our counter and reset it's effects
    private void EndPowerup(Powerup.Type type)
    {
        // Disable particle effects
        particleController.SetEffectActive(type, false);

        // Remove gameplay effects
        PowerupEndtimes.Remove(type);

        switch (type)
        {
        case Type.BOOST:
            playerMovement.setBoostCooldown(stats.DEFAULT_COOLDOWN);
            break;

        case Type.POWER:
            playerMovement.setBoostPower(stats.DEFAULT_BOOST_POWER);
            break;

        case Type.STICKY:
            playerMovement.SetRotationSpeed(stats.DEFAULT_ROTATION_SPEED);
            break;

        case Type.BANANA:
            playerMovement.SetRotationSpeed(stats.DEFAULT_ROTATION_SPEED);
            playerMovement.GetComponent <Rigidbody> ().angularDrag = 10;
            break;

        case Type.SHIELD:
            break;
        }
    }
Exemplo n.º 2
0
    private float FlashTimeForPowerup(Powerup.Type type)
    {
        // this method kinda sucks. Ideally it's a fixed time apart from a few special cases where they are short durations?
        switch (type)
        {
        case Type.STICKY:
            return(stats.STICKY_DURATION / 4);

        case Type.BOOST:
            return(stats.BOOST_DURATION / 2);

        case Type.POWER:
            return(stats.BOOST_DURATION / 4);

        case Type.BANANA:
            return(stats.BANANA_POWER / 2);

        case Type.SHIELD:
            return(stats.SHIELD_DURATION / 4f);

        default:
            return(0);
        }
    }
Exemplo n.º 3
0
 public float TimeForPowerup(Powerup.Type type)
 {
     return(PowerupEndtimes [type]);
 }