# How do i flip sprites?

**URL:** <https://forum.makecode.com/t/how-do-i-flip-sprites/505>\
**Category:** Arcade\
**Created:** [September 1, 2019, 1:28pm UTC](https://forum.makecode.com/t/how-do-i-flip-sprites/505 "2019-09-01T13:28:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomisOps](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@TomisOps](https://forum.makecode.com/u/TomisOps)\
**Post date:** [September 1, 2019, 1:28pm UTC](https://forum.makecode.com/t/how-do-i-flip-sprites/505/1 "2019-09-01T13:28:48Z")

</div>

Any way to flip characters? thanks

---

<div class="post-metadata">

**Author:** ![ChaseMor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chasemor/32/18_2.png) [@ChaseMor](https://forum.makecode.com/u/ChaseMor)\
**Post date:** [September 1, 2019, 8:48pm UTC](https://forum.makecode.com/t/how-do-i-flip-sprites/505/2 "2019-09-01T20:48:20Z")

</div>

There’s a block in the images category if that does it if that helps.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/1eae9fc072d224e49f840e843ceb032071e8988d.png)

If you want to flip it in the sprite editor there isn’t an easy way to do it. When I need to do it, I go to the JavaScript code where the image is stored as a bunch of hex characters where each pixel represents one character. I then copy the lines into a text tool that reverses the order of the lines. Effectively flipping the image vertically. [Here is the tool I use.](https://www.browserling.com/tools/reverse-lines)

For flipping horizontally, I transpose the text [using this tool](https://www.browserling.com/tools/text-transpose), then use the line reversal tool on that output, then feed that output back into the transpose tool to transpose it again. Then paste that output back into the JavaScript (making sure the indentation is the same) and switch back to blocks.

I hope that helps. Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![TomisOps](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@TomisOps](https://forum.makecode.com/u/TomisOps)\
**Post date:** [September 2, 2019, 11:35am UTC](https://forum.makecode.com/t/how-do-i-flip-sprites/505/3 "2019-09-02T11:35:11Z")

</div>

Thank you for the extensive response! Really helped me, thanks!!

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forum.makecode.com/u/kjw)\
**Post date:** [September 3, 2019, 10:54am UTC](https://forum.makecode.com/t/how-do-i-flip-sprites/505/4 "2019-09-03T10:54:28Z")

</div>

I needed to flip some sprites the other day and ended up manually re-drawing them.

It would be useful to have rotation and symmetry flips in the sprite editor particularly if they use less memory by being in the program and stored in flash memory rather than precious RAM?

For comparison, I see Scratch has flips and arbitrary angle rotation (of any selected area) in its editor.

---

<div class="post-metadata">

**Author:** ![ChaseMor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chasemor/32/18_2.png) [@ChaseMor](https://forum.makecode.com/u/ChaseMor)\
**Post date:** [September 3, 2019, 9:42pm UTC](https://forum.makecode.com/t/how-do-i-flip-sprites/505/5 "2019-09-03T21:42:29Z")

</div>

I believe the plan is to allow for simple rotations (e.g. 90°, 180°, and 270°) and simple horizontal and vertical flipping.

Due to the resolution, color, and canvas size limitations, rotating by other angles isn’t really possible. This gets brought up a lot and here’s a thread where we talked about some solutions.

> [@Having a Blast with MakeCode Arcade!](https://forum.makecode.com/t/having-a-blast-with-makecode-arcade/59/5):
>
> When it comes to rotating sprites, it’s a quite difficult task given the resolution of the sprites. I’ve implemented an algorithm called RotSprite that rotates low resolution images in a way that is more aesthetically pleasing than traditional rotations. You can add it as an extension with the url: [https://github.com/ChaseMor/pxt-arcade-rotsprite](https://github.com/ChaseMor/pxt-arcade-rotsprite). [Here is an example of this extension](https://makecode.com/_77PK319kX6aJ) It’s a pretty basic implementation though. There’s definitely some optimizations that can be made. For an aste…
