# Left, top, right and bottom movement controls in mobile?

**URL:** https://phaser.discourse.group/t/left-top-right-and-bottom-movement-controls-in-mobile/3340
**Category:** Phaser 3
**Created:** [August 3, 2019, 12:20pm UTC](https://phaser.discourse.group/t/left-top-right-and-bottom-movement-controls-in-mobile/3340 "2019-08-03T12:20:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nagFlapjacks](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@nagFlapjacks](https://phaser.discourse.group/u/nagFlapjacks)
#### Post date: [August 3, 2019, 12:20pm UTC](https://phaser.discourse.group/t/left-top-right-and-bottom-movement-controls-in-mobile/3340/1 "2019-08-03T12:20:35Z")

</div>

I am doing a game on space ship battle, it works fine on the desktop with the keys of the keyboard. in case of mobile, I want it to be done on the touch of the canvas as of that pointer x and y the player should move left, right, top and bottom.

---

<div class="post-metadata">

### Author: ![wclarkson](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/wclarkson/32/205_2.png) [@wclarkson](https://phaser.discourse.group/u/wclarkson)
#### Post date: [August 4, 2019, 5:32am UTC](https://phaser.discourse.group/t/left-top-right-and-bottom-movement-controls-in-mobile/3340/2 "2019-08-04T05:32:17Z")

</div>

I would suggest detecting pointers in relation to the player.

For example

this.input.on(‘pointerdown’,this.movePlayer.bind(this));

```
 movePlayer(pointer) {
        if (pointer.x < this.player.x) {
            //move left 
            player.x--;
        }
    }
```

---

<div class="post-metadata">

### Author: ![nagFlapjacks](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@nagFlapjacks](https://phaser.discourse.group/u/nagFlapjacks)
#### Post date: [August 9, 2019, 7:00am UTC](https://phaser.discourse.group/t/left-top-right-and-bottom-movement-controls-in-mobile/3340/3 "2019-08-09T07:00:32Z")

</div>

i did it in same way but i am not satisfied with the scenario below  
player.x = 10;  
pointer.x = 30;  
pointer.y = -30;

while moving the player it is not looking good. hope you got what i meant to say here.
