# Moving Background

**URL:** <https://forum.code.org/t/moving-background/32490>\
**Category:** CS Discoveries\
**Created:** [March 24, 2020, 7:50pm UTC](https://forum.code.org/t/moving-background/32490 "2020-03-24T19:50:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![puilanghe](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@puilanghe](https://forum.code.org/u/puilanghe)\
**Post date:** [March 24, 2020, 7:50pm UTC](https://forum.code.org/t/moving-background/32490/1 "2020-03-24T19:50:50Z")

</div>

One of my students is creating a game using [code.org](http://code.org) for Game4Changes. He wants the background to extend when the sprite walks to the edge of the screen. Is there any way to do that in Game Lab? Thanks!

---

<div class="post-metadata">

**Author:** ![mkmietowicz](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mkmietowicz/32/6322_2.png) [@mkmietowicz](https://forum.code.org/u/mkmietowicz)\
**Post date:** [March 24, 2020, 11:53pm UTC](https://forum.code.org/t/moving-background/32490/2 "2020-03-24T23:53:44Z")

</div>

Hi @puilanghe,

Is the student looking to have the background extend or scroll? The viewable area is always going to be 400 x 400 px. However, they can get creative with sprites if they want the background to appear to be scrolling. I’d have them check out the model games at the back half of Unit 3 if they need ideas.

Hope that helps,  
–Michael K.

---

<div class="post-metadata">

**Author:** ![puilanghe](https://avatars.discourse-cdn.com/v4/letter/p/43a26b/32.png) [@puilanghe](https://forum.code.org/u/puilanghe)\
**Post date:** [March 25, 2020, 3:28pm UTC](https://forum.code.org/t/moving-background/32490/4 "2020-03-25T15:28:21Z")

</div>

Okay. Thank you for your response!!

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [March 25, 2020, 9:09pm UTC](https://forum.code.org/t/moving-background/32490/5 "2020-03-25T21:09:39Z")

</div>

If you student is advanced, it might be worth checking out the “camera.x” and “camera.y” properties, which change the part of the game that is visible on the screen. This might be an easier way to scroll a game than trying to scroll every element. There’s not a lot of documentation on these properties, so it might take a bit of playing around with them.

Elizabeth
