Page 1 of 1

How do I temporarily disable the side scrolling background?

PostPosted: Wed Jan 28, 2009 7:21 pm
by He360
I made my game with mostly a side scrolling background, but there is one sceen in there in which I would like the background to be still until the next level. I was wondering how do I temporarily stop the background from scrolling when the character is moving.

It seems like something simple, but I've tried everything (including making the character collide with borders that I made, etc), but I still couldn't do it. Anyway, thanks.

Re: How do I temporarily disable the side scrolling background?

PostPosted: Wed Jan 28, 2009 7:28 pm
by speckford123
we might need more information on what your talking about here
is it scrolling as you walk by code? or is it just a repeated background?

have you tried using collision boxes to temporarily disable the scrolling?
or you could create a secondary background on top of your first one that gets destroyed once you get to the next level

just give some details, many of us would be glad to help :D

Re: How do I temporarily disable the side scrolling background?

PostPosted: Wed Jan 28, 2009 9:50 pm
by He360
Yes, at first in my game, I have a repeated background in which my character walks by everything. That is, I used the steps that the tutorial that comes with the game gave us e.g. the x = x + 5; and the x = x – 5; codes, with the character being the parent of the view, etc).

But in one particular level, I don’t want the character to walk by a repeated background. I want one particular background to stays put, and I don’t want the character to be able to go past that background.

I was thinking to temporarily disable the character from being the parent of the view. But I don’t know how to do that (I’ve tried). I also tried putting walls around the particular scene so that the character can’t go past it (collision with a physical response), but for some reason that’s not working. Maybe I’m doing something wrong.

I hope this helps.

HE

Re: How do I temporarily disable the side scrolling background?

PostPosted: Wed Jan 28, 2009 10:13 pm
by jimmynewguy
if the background is parented with the view and thats what's moving it. then in draw actor for the bg have a variable called move and if move = 1 change the parent to view and if move = 0 change the parent to none
do you understand?

Re: How do I temporarily disable the side scrolling background?

PostPosted: Thu Jan 29, 2009 4:10 am
by DST
Make the stopped background another actor alltogether. Here I'll call them scrollbg and stopbg.

Give stopbg this line in it's CreateActor script:
Code: Select all
VisibilityState("Event Actor", DISABLE);


Now on any event you want, do this: (here i'll use collision with filled region)

player>collision>any side>filled region>repeat:no
Code: Select all
VisibilityState("scrollbg", DISABLE);
VisibilityState("stopbg, ENABLE);


And just reverse it when you want the scrolling background back.