# Image direction changing

**URL:** <https://forum.makecode.com/t/image-direction-changing/47173>\
**Category:** Help\
**Created:** [November 10, 2026, 10:21pm UTC](https://forum.makecode.com/t/image-direction-changing/47173 "2026-11-10T22:21:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Master\_zone\_goober](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/master_zone_goober/32/37181_2.png) [@Master\_zone\_goober](https://forum.makecode.com/u/Master_zone_goober)\
**Post date:** [November 10, 2026, 10:21pm UTC](https://forum.makecode.com/t/image-direction-changing/47173/1 "2026-11-10T22:21:04Z")

</div>

in a game I am working on by pressing b it does a knife attack but I want it so that the image flips and the tip faces wherever you are facing. Can anyone help me?  
here is the b button code

 ![Screenshot 2026-11-10 215846](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/7/573b0603d71dd49950f622b0d66ab5bf4d3a9caf.png)

---

<div class="post-metadata">

**Author:** ![Sword\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sword_studios/32/36911_2.png) [@Sword\_Studios](https://forum.makecode.com/u/Sword_Studios)\
**Post date:** [November 11, 2026, 4:39am UTC](https://forum.makecode.com/t/image-direction-changing/47173/2 "2026-11-11T04:39:21Z")

</div>

do a “if knife x \< mySprite x then flip knife image”

---

<div class="post-metadata">

**Author:** ![Master\_zone\_goober](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/master_zone_goober/32/37181_2.png) [@Master\_zone\_goober](https://forum.makecode.com/u/Master_zone_goober)\
**Post date:** [November 12, 2026, 1:45am UTC](https://forum.makecode.com/t/image-direction-changing/47173/3 "2026-11-12T01:45:08Z")

</div>

Thanks!
