# Platformer Movement Speed?

**URL:** <https://forum.makecode.com/t/platformer-movement-speed/15743>\
**Category:** Help\
**Created:** [October 6, 2022, 5:48pm UTC](https://forum.makecode.com/t/platformer-movement-speed/15743 "2022-10-06T17:48:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoMustangs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gomustangs/32/4323_2.png) [@GoMustangs](https://forum.makecode.com/u/GoMustangs)\
**Post date:** [October 6, 2022, 5:48pm UTC](https://forum.makecode.com/t/platformer-movement-speed/15743/1 "2022-10-06T17:48:48Z")

</div>

Does anyone know how to code a platformer character who can speed up or slow down? Like Mario 3 or Sonic?

I’m trying to get a character to speed up and slow down when changing directions, but it’s super choppy.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 6, 2022, 6:22pm UTC](https://forum.makecode.com/t/platformer-movement-speed/15743/2 "2022-10-06T18:22:04Z")

</div>

Here is some sample code for you! I added some comments to explain everything, but let me know if you have any questions!

> **[platformer-momentum](https://arcade.makecode.com/14166-97150-14479-79821)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [October 6, 2022, 6:23pm UTC](https://forum.makecode.com/t/platformer-movement-speed/15743/3 "2022-10-06T18:23:28Z")

</div>

Also, this example uses one value for acceleration and friction, but you could theoretically split those values out. It might make sense for friction to be slower than acceleration for some games
