# Background Image Question

**URL:** <https://forum.makecode.com/t/background-image-question/4095>\
**Category:** Help\
**Created:** [October 26, 2020, 8:40pm UTC](https://forum.makecode.com/t/background-image-question/4095 "2020-10-26T20:40:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![timber](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@timber](https://forum.makecode.com/u/timber)\
**Post date:** [October 26, 2020, 8:40pm UTC](https://forum.makecode.com/t/background-image-question/4095/1 "2020-10-26T20:40:20Z")

</div>

I am working with a student who made a 512 x 512 background image. He was trying to have his sprite move across it similar to having a large tilemap and using the camera follow sprite block. Is there a way to do this?

It also looks like the editor is cropping the image? Is there a max size for a background image?

> **[kierans folly #2](https://arcade.makecode.com/14124-04468-08523-28456)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)\
**Post date:** [October 26, 2020, 9:12pm UTC](https://forum.makecode.com/t/background-image-question/4095/2 "2020-10-26T21:12:03Z")

</div>

Ah, so the issue is that background images are “fixed” to the camera. Here’s a quick example–the image is always centered on the camera even as the player moves through the tilemap:

> **[background-image](https://arcade.makecode.com/82024-97475-04914-98362)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

You’ll want to instead create a fake background image sprite, set a tilemap to define the bounds of the world (otherwise the player can move infinitely in any direction), and center the background image sprite in that tilemap. Here’s the code for it!

> **[large-background-image](https://arcade.makecode.com/31456-58196-90346-32197)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![timber](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@timber](https://forum.makecode.com/u/timber)\
**Post date:** [October 26, 2020, 9:41pm UTC](https://forum.makecode.com/t/background-image-question/4095/3 "2020-10-26T21:41:58Z")

</div>

Perfect! That’s great solution. I really appreciate the help.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 26, 2020, 10:09pm UTC](https://forum.makecode.com/t/background-image-question/4095/4 "2020-10-26T22:09:40Z")

</div>

I found the solution to be somewhat buggy. Maybe it was my computer, but after I while I could not move the sprite very well. Once it moved to an edge of the screen, I could not move the sprite anymore, and when I could the controller events were being queued up. There was a delay in movement. I suspect because the background image is so large.

---

<div class="post-metadata">

**Author:** ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)\
**Post date:** [October 26, 2020, 10:40pm UTC](https://forum.makecode.com/t/background-image-question/4095/5 "2020-10-26T22:40:30Z")

</div>

Oh, good call, the other thing that might be useful here is to set “ghost” to true for the image! It should significantly improve performance, as we’ll skip collision checking for the large background image.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9f1b49d3c332e631c0680074582b474db895c5fb.png)

---

<div class="post-metadata">

**Author:** ![timber](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@timber](https://forum.makecode.com/u/timber)\
**Post date:** [October 26, 2020, 11:09pm UTC](https://forum.makecode.com/t/background-image-question/4095/6 "2020-10-26T23:09:15Z")

</div>

Oh, I was experiencing the same thing. I didn’t make that connection though. I will test the ghost solution as well.  
Thank you everyone. I appreciate it.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 27, 2020, 4:58pm UTC](https://forum.makecode.com/t/background-image-question/4095/7 "2020-10-27T16:58:52Z")

</div>

That works much better, and is logical as well; no need to collide with the background 😁  
I might just have to use this example code for my next game.
