# Chopper like decceleration

**URL:** <https://forum.kirupa.com/t/chopper-like-decceleration/192067>\
**Category:** Uncategorized\
**Created:** [June 25, 2006, 7:57pm UTC](https://forum.kirupa.com/t/chopper-like-decceleration/192067 "2006-06-25T19:57:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitras](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitras/32/1475_2.png) [@nitras](https://forum.kirupa.com/u/nitras)\
**Post date:** [June 25, 2006, 7:57pm UTC](https://forum.kirupa.com/t/chopper-like-decceleration/192067/1 "2006-06-25T19:57:34Z")

</div>

Hi it’s sunday so i am experimenting again

trying to build a realistic helicopter blade movement

the acceleration works fine

but when i loose hold of the button that has been pressed  
i’d like it to see reach an max value  
then when the button is released it slowly deccelerates to zero

can anyone point me to what i am doing wrong?

```auto

var velocity:Number = 1;
var break:Number;
var maxvelocity:Number = 50;
velocityt.text = 0;
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
    if (Key.isDown(Key.UP)) {
        velocity += 0.2;
        wiek._rotation += 1+velocity;
        trace("new :"+Math.round(velocity));
        velocityt.text = "velocity : " + Math.round(velocity);
    if (Math.round(velocity) == maxvelocity) {
            trace("final vel "+Math.round(velocity));
            velocityt.text = "velocity : " + Math.round(velocity);
            maxvel.text = "maximum reached"
            stat.text = "lift off";
            wiek._rotation = maxvelocity;
            
        } else {
            ("decceleration"+Math.round(velocity));
            brake = 7;
            wiek._rotation -= velocity/brake;
        }
    }
};
Key.addListener(keyListener);

```
