# Acceleration?

**URL:** <https://forum.kirupa.com/t/acceleration/39087>\
**Category:** Uncategorized\
**Created:** [January 3, 2004, 1:37am UTC](https://forum.kirupa.com/t/acceleration/39087 "2004-01-03T01:37:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![macneilslt](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@macneilslt](https://forum.kirupa.com/u/macneilslt)\
**Post date:** [January 3, 2004, 1:37am UTC](https://forum.kirupa.com/t/acceleration/39087/1 "2004-01-03T01:37:34Z")

</div>

Okay, i have this right now for movement on a shark MC i made:

[AS]

onClipEvent(enterFrame) {  
if(key.isDown(key.RIGHT) and this.\_x \< 400 ) {  
this.\_x +=10;  
this.gotoAndStop(1);  
}  
else if(key.isDown(key.RIGHT) and this.\_x \>= 400) {  
this.\_x = 50;  
}  
if(key.isDown(key.LEFT) and this.\_x \> 0) {  
this.\_x -= 10;  
this.gotoAndStop(2);

```
}
else if(key.isDown(key.LEFT) and this._x &lt;= 0) {
	this._x = 350;
	
}
if(key.isDown(key.UP) and this._y &gt; 20) {
	this._y -= 10;
}
            if(key.isDown(Key.DOWN) and this._y &lt; 380) {
	this._y +=10;
}

```

}

[/AS]

how could i go about altering that, so that it would speed up/slow down gradually, opposed to just moving full speed right away? so that it looks more like a fish swimming in water…
