# Moving backgroud coordinate issue

**URL:** <https://discourse.processing.org/t/moving-backgroud-coordinate-issue/26107>\
**Category:** Coding Questions\
**Created:** [December 10, 2020, 5:31am UTC](https://discourse.processing.org/t/moving-backgroud-coordinate-issue/26107 "2020-12-10T05:31:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![millionish](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@millionish](https://discourse.processing.org/u/millionish)\
**Post date:** [December 10, 2020, 5:31am UTC](https://discourse.processing.org/t/moving-backgroud-coordinate-issue/26107/1 "2020-12-10T05:31:54Z")

</div>

I’m making a top down shooter game. The way I’m moving the player is by keeping him in the center of the screen and moving the background instead. But as I move it, the coordinates of the screen change continuously and I’m not able to detect the fixed coordinates for enemy object on screen.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [December 10, 2020, 10:38am UTC](https://discourse.processing.org/t/moving-backgroud-coordinate-issue/26107/2 "2020-12-10T10:38:32Z")

</div>

you shouldn’t move the player at all.

just say image (player, width/2, 100); or so

the keys change playerX – and ++

the background image moves:

`image(backgroundImg, 0 - playerX, 0);`

**Remark**

Issue is more when the image has scrolled totally left or right and it’s on its end. Because then, the player moves and the background is fixed.

Chrisir
