# 360 degree spritesheet help

**URL:** <https://phaser.discourse.group/t/360-degree-spritesheet-help/12679>\
**Category:** Phaser 3\
**Created:** [December 17, 2022, 10:50pm UTC](https://phaser.discourse.group/t/360-degree-spritesheet-help/12679 "2022-12-17T22:50:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wondermen](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/wondermen/32/7192_2.png) [@wondermen](https://phaser.discourse.group/u/wondermen)\
**Post date:** [December 17, 2022, 10:50pm UTC](https://phaser.discourse.group/t/360-degree-spritesheet-help/12679/1 "2022-12-17T22:50:57Z")

</div>

hi everyone;

I want the ship in the image to change the frame according to the position I click with the mouse.

Spritesheet image;

 ![ship](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/6/607a623a7e7c6d0509fc2f9539d7b118d6fd5303.jpeg)

So, this is what I want;  
 ![ship_space](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/9/95320f93bbbe1a428b6f768d119ef1ed3d468096.gif)

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 17, 2022, 10:57pm UTC](https://phaser.discourse.group/t/360-degree-spritesheet-help/12679/2 "2022-12-17T22:57:07Z")

</div>

This is a bit like

> [@Detect the cardinal direction of mouse pointer](https://phaser.discourse.group/t/detect-the-cardinal-direction-of-mouse-pointer/3795/4):
>
> Here is one way to do it:

---

<div class="post-metadata">

**Author:** ![wondermen](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/wondermen/32/7192_2.png) [@wondermen](https://phaser.discourse.group/u/wondermen)\
**Post date:** [December 18, 2022, 1:19am UTC](https://phaser.discourse.group/t/360-degree-spritesheet-help/12679/4 "2022-12-18T01:19:05Z")

</div>

@samme

I tried the codes as a result, it partially saved, but cannot fully.

![ezgif.com-gif-maker](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/d/dfcc2f19b5b09aab058cfab857cdd011ad0114f7.gif)

---

<div class="post-metadata">

**Author:** ![wondermen](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/wondermen/32/7192_2.png) [@wondermen](https://phaser.discourse.group/u/wondermen)\
**Post date:** [December 18, 2022, 3:20am UTC](https://phaser.discourse.group/t/360-degree-spritesheet-help/12679/5 "2022-12-18T03:20:03Z")

</div>

@samme  
I increased the coordinates from 8 to 32 with some hassle. it will do 🙂 thanks.

FINAL GIF;  
 ![dd](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/9/9ed5476c6da1150d804fb7a53f43e0ebcb3b0f2d.gif)

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 18, 2022, 12:09pm UTC](https://phaser.discourse.group/t/360-degree-spritesheet-help/12679/6 "2022-12-18T12:09:10Z")

</div>

Yes, the important part is

```
Phaser.Math.Snap.To(angle, Phaser.Math.PI2 / 32)

```
