# Help me make my character move

**URL:** <https://forum.makecode.com/t/help-me-make-my-character-move/41525>\
**Category:** Help\
**Created:** [January 15, 2026, 5:52pm UTC](https://forum.makecode.com/t/help-me-make-my-character-move/41525 "2026-01-15T17:52:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDarkCrown](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thedarkcrown/32/28059_2.png) [@TheDarkCrown](https://forum.makecode.com/u/TheDarkCrown)\
**Post date:** [January 15, 2026, 5:52pm UTC](https://forum.makecode.com/t/help-me-make-my-character-move/41525/1 "2026-01-15T17:52:48Z")

</div>

![Screenshot 2026-01-15 11.17.42 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/d/6d5a64b93843afd48c13ecca9e14d07cbb5c7394.png)I want to make my sprite(Blocky) look in the direction that its moving and then when its not moving it returns back to the front facing sprite. Anyone know what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![Peau12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peau12/32/29299_2.png) [@Peau12](https://forum.makecode.com/u/Peau12)\
**Post date:** [January 15, 2026, 11:59pm UTC](https://forum.makecode.com/t/help-me-make-my-character-move/41525/2 "2026-01-15T23:59:59Z")

</div>

These should do the trick! And welcome!

 ![arcade-screenshot (13)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/d/1d448b661ebfee5b3d40d0a6a377d4e270e29143.png)

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [January 16, 2026, 12:02am UTC](https://forum.makecode.com/t/help-me-make-my-character-move/41525/3 "2026-01-16T00:02:08Z")

</div>

The reason why this doesn’t work is because the “else” scripts will never run as it’s impossible for them to run, since the script can only check if the corresponding arrow is pressed, which it will always be true.

Instead, use an “On game update” and replace the key press booleans with vx check booleans: Like this:

 ![Block code variant](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/c/fc8c07e3475d8b40105b98eafe70dd1cb460e0c8.png)

```auto
let myPlayer = sprites.create(assets.image`playerFront`, SpriteKind.Player)
controller.moveSprite(myPlayer, 100, 0)
game.onUpdate(function () {
    myPlayer.setImage(assets.image`playerFront`)
    if (myPlayer.vx > 0) {
        myPlayer.setImage(assets.image`playerRight`)
    } else if (myPlayer.vx < 0) {
        myPlayer.setImage(assets.image`playerLeft`)
    }
})

```

Here’s the JavaScript variant of the same code.

```auto
myPlayer = sprites.create(assets.image("""playerFront"""), SpriteKind.player)
controller.move_sprite(myPlayer, 100, 0)

def on_on_update():
    myPlayer.set_image(assets.image("""playerFront"""))
    if myPlayer.vx > 0:
        myPlayer.set_image(assets.image("""playerRight"""))
    elif myPlayer.vx < 0:
        myPlayer.set_image(assets.image("""playerLeft"""))
game.on_update(on_on_update)

```

Here’s the Python variant of the same code.  
Hope you learn something from this!

---

<div class="post-metadata">

**Author:** ![TheDarkCrown](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thedarkcrown/32/28059_2.png) [@TheDarkCrown](https://forum.makecode.com/u/TheDarkCrown)\
**Post date:** [January 16, 2026, 5:56pm UTC](https://forum.makecode.com/t/help-me-make-my-character-move/41525/4 "2026-01-16T17:56:01Z")

</div>

This worked!

Thank you so much!
