Skip to main content
Inspiring
April 25, 2010
Answered

Scrolling background. Best way to do it.

  • April 25, 2010
  • 1 reply
  • 1066 views

Hi, making my English teaching games as usual with your help.

I have my character walking now which is lovely. I'd like her to walk along a beach and when she comes to the edge or probably before - for the beach to continue ie: the bg scrolls on to the left giving the appearance of movement. BUT I don't know whether to stick in a massive bg ie: 5 times the stage width so the character can walk for a long time or b) Create one twice the size and just loop it. Is there any disadvantage to the first one as the bg would be very big and a lot to scroll as I will be going fullscreen,

This topic has been closed for replies.
Correct answer

Trying to use my head as well, trying to learn - I could move the background to the left as the mc character clicks to the right ie: She never moves only the bg as muh as she clicks to the right. Would that be right???


From what I gather from reading your post, it sounds like your best bet is to scroll the background as the character moves, keeping the character center screen... but it's really up to you. You may want to hunt around and do some reading on making scrolling games - searching for scrolling game and/or platform scroller, etc.

1 reply

April 25, 2010

There's really no disadvantage doing it either way - the only thing about the massive bg image is memory consumption, and that's typically not an issue either. I've done similar things where I loaded n images into a movie clip that came out being like 12K pixels wide and it scrolled without issue.

Inspiring
April 25, 2010

Sounds good. So instead of loading a bg 10 times the size of the stage I could load one that¡s twice the size and then load the other parts as needed. If there are two loaded at any given time then the scrolling will seem seamless so we don't have to scroll the big 10 times sized one. Or would it be OK anyway - remember I go fullscreen which seems to hinder performance at times.

April 25, 2010

No, what I said was loading in bunch of images and creating one giant clip from them and scrolling that is fine. Going full-screen can hinder performance because you're scaling everything - on every frame... and that is slow.