# Moving background as player moves

**URL:** <https://discourse.processing.org/t/moving-background-as-player-moves/25854>\
**Category:** Processing.py\
**Created:** [December 1, 2020, 6:59am UTC](https://discourse.processing.org/t/moving-background-as-player-moves/25854 "2020-12-01T06:59:20Z")\
**Posts on this page:** 2\
**Page:** 2

<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 8, 2020, 6:18pm UTC](https://discourse.processing.org/t/moving-background-as-player-moves/25854/23 "2020-12-08T18:18:07Z")

</div>

```auto
def clock():
    global sec, minutes, hours, col
        
    sec+=1
    if(sec == 60):
        sec = 0
        minutes+=1
    if(minutes == 60):
        minutes = 0
        hours+=1
    if(hours == 24):
        hours = 0
        minutes = 0
        sec = 0
            
    textSize(25)
    fill(255, 0, 0)
    text(floor(sec), 185, 110)
    text(floor(minutes), 135, 110)
    text(floor(hours), 85, 110)
    
    if(sec % 2 == 0):
        col = color(0)
    else:
        col = color(255, 0, 0)
    
    fill(col)
    textSize(30)
    text(":", 120, 110)
    text(":", 170, 110)

```

---

<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 9, 2020, 6:39pm UTC](https://discourse.processing.org/t/moving-background-as-player-moves/25854/24 "2020-12-09T18:39:15Z")

</div>

hey, for some reason, due to background movement, the coordinates change as player moves, and I’m unable to get the coordinates for the enemy object. Please help.

[Previous page](https://discourse.processing.org/t/moving-background-as-player-moves/25854.md?page=1)
