Scrollable Background on Loop
overzero3
Member Posts: 18
I know there is a lot of discussions about this, but i could not find an answer in any of thoses.
I'm trying to make a scrollable background on loop in the X axis.
What i did was to put my background image (same size as my camera) on a non scrollable layer with a move behaivor to the right and set the game to Wrap X. But what happens is that the image only appear in the left side when its completely gone from the right side.
I tried duplicating the image and put them side by side so that when the first one disappears the other one is still running, but the result was akward. I dont know exaclty how to explain but in some point the image kind looks like it took too long to load and just pop after a moment of grey background area. I also tried to make the image twice as large but no good came from it.
What am I doing wrong? There is something i can do to make this transition looks seamless?
PS: Another minor question: is there a way to zoom out my workspace on GS? I'm doing a game with 720HD resolution and it kind of annoys me that I cant see the whole workspace like, say, photoshop...
I'm trying to make a scrollable background on loop in the X axis.
What i did was to put my background image (same size as my camera) on a non scrollable layer with a move behaivor to the right and set the game to Wrap X. But what happens is that the image only appear in the left side when its completely gone from the right side.
I tried duplicating the image and put them side by side so that when the first one disappears the other one is still running, but the result was akward. I dont know exaclty how to explain but in some point the image kind looks like it took too long to load and just pop after a moment of grey background area. I also tried to make the image twice as large but no good came from it.
What am I doing wrong? There is something i can do to make this transition looks seamless?
PS: Another minor question: is there a way to zoom out my workspace on GS? I'm doing a game with 720HD resolution and it kind of annoys me that I cant see the whole workspace like, say, photoshop...
Comments
As to your first issue, it seems you just want an animated (x-axis) background that follows the camera. Not a "scrollable" background as that would just be a regular background. There are two ways you could do this. duplicate the background image actor so that you have two. Place one directly on top of the camera, then place one directly to the right of the camera.
So if the camera is lets say 200x150px the first background would be at a 100x75y location and the second would be at 300x75y location.
Then place the same behaviours in both background actors:
move: direction 180, speed whatever
rule:
attribute: self.position.X =< -100
- change attribute: self.position.X = 300
What this will do is that when the first background gets to -100 (meaning it is completely off screen to the left) it will jump to completely off screen to the right and continue moving left again. It will repeat this behaviour. Just substitute your numbers in for the ones I used.Now this is not technically ideal as you may get a small black line on the edge between the two background actors. This may or may not be noticeable due to the processor speed, background color and the color of the background image.
Your other option is to create an animation of the image tiling in flash or photoshop and export it out as a png sequence. This will be very CPU intensive though and is not recommended.
Well, anyway, let me get this straight!
So, I basically put two images side by side, and them add a rule that, when they get offscreen, they appear in the other side, also offscreen? Isnt that the same thing I did, only without Wrap X? Is there any advantage to this method, like performance or something?
I sorry, but i'm starting to believe that i am doing something way wrong and i'm too stupid to realize what it is. Please, walk me throught...
My project is in HD, so my camera is 1280x720 pixels. Thats also the size of my background image. I placed two of them, first one position is 640x360 and the second one is 1920x360. The actors logic is:
Move Direction 180º
When Self.Position.X =< - 640
Change Self.Position.X to 1920
Am i doing everything right so far? Than why it doesnt work! o.o
My son and I are working with the same issue. And the longer the game is played, the more our thin black line gets thicker and thicker, which as you can imagine is unacceptable. I have made the background art in parts that match up perfectly and don't understand why we can't program an exact number based on a correct size. Shouldn't we be able to put in a correct (exact) number and get that to repeat seamlessly? The artwork meshes perfectly. We just need help with the code (for a horizontal looping background (on the long --960 pixel --side).
Any help on this is appreciated
This is our second game. The first didn't have a moving background, and I am not the programmer. I am making the art. Hopefully someone has the answer for us. Can a background scroll repeatedly in GameSalad (horizontally)?
I thought there would be an easy answer to this problem.
Thanks in advance.
Turn on wrap x. Have the items move to left (or right. which ever way u desire) and it should loop automatically. Make sure items are movable and make sure that if you have some sort of gravity on, that you constrain the scrolling items y position so that it doesn't "fall" off the scene
Up untill now, neither wraping the background or changing position worked well enough! This is really frustating.
If someone ever find something that work, please share with us!
if u want u can send me the project file and i'll take a look
3xL.Ent@gmail.com
It is more than frustrating, and it is also very surprising. This is our second game. Our first used static backgrounds and we enjoyed making it within GameSalad. Now we are evolving and need the background to loop continuously. I was under the impression (now false I guess) that the way computers work is that if one enters the correct number, the sequence would work the same way again and again. But when we scroll the background there is a vertical black line that, if anything increases overtime.
I would imagine that there should be a set size (FOR THE BACKGROUND STRIP) that one can use to loop, based on the fact that the horizontal window is 960 pixels. Rather than send in an incorrect project to 3xL, for example, (which I appreciate the offer) I will happily modify my artwork with the size info. I will make the background strip to fit the program requirements--to whatever the correct size should be.
We are at wits end with this. Again thanks in advance. We did write GameSalad support and they pointed us (twice) to the Forum here to find our answer. So I am looking to the community for help on this.
1) Make the scene size as long as needed (the length of all the background graphics added together).
2) Place the background graphics in their correct sequential locations on the scene.
3) Give the "hero" actor a control camera behavior. As the hero runs the camera will follow the actor and pan across the background graphics.
4) When the hero reaches the end of the scene -- set its x position back to the beginning. (Set up the graphics so that the jump back to the beginning looks seamless. The last part of the right side of the background should look exactly like the beginning at the left side.)
My project is a Dual Stick Shooter, so the player will move freely in the scene. What I was trying to make was a background effect, where a fog image would move slowly in a separeted layer. This is by no means essencial to the gameplay itself, but it is a nice visual effect that make the game stand out a little bit.
I made this fog image in Photoshop in a way that the left and right side match perfectly. The problem is match the movement in GS perfectly!
By the way...i figured i could do a little different, and insteed of making a fixed image move, i would make a looping fog effect on After Effects and export as a sequence of PNG. The problem is, the number of pictures is way too high! How many images should i have in an animated actor? How many is the ideal not to drop performance?
This question also apply to characters animations, such as enimies. I want my enimies to have simple animations, but dont know for sure how many frames i should use. I mean, its a dual stick shooter...expect a lot of enimies on screen at the same time!
3xL, if you dont mind i am sending you a project with two scenes in wich i tried this background effect. If you could help me out, i couldnt be more appreciated!
http://forums.gamesalad.com/discussion/40282/scrolling-background-not-using-scene-wrapping-please-help
have you thought about making the scene the color of your BG and then just adding in all the other stuff with a transparent BG so you can't tell if there is ever a gap?
Email = gilles@gshelper.com ----- Skype = Tshirtbooth"
killerpenguins MEMBER February 28
I had it run for about 30 min on my iPod and it was going at 60 FPS and it started to space apart. I did think about that and tried it but because the level of detail and shades my background is, you are able to tell when it gaps apart. This is a pain in the behind! LOL Again, thanks!"
So, wow I am quoting that thread to here now and the final post in that thread still states that Tshirtbooth's code isn't working. Am I to conclude that GameSalad can't successfully scroll a seamless background? WIth all the GameSalad development out there, and the participants on this forum, isn't there a working solution?
I am using this post as a final plea for a solution to this problem.
Help glub, glub we are drowning if we can't get a life saver here.
Much appreciated!
https://www.dropbox.com/s/6lyessyxc1ai3r9/scrolling background.zip
what coordinates should I use for that?
friends any help here. I am stuck badly with the background.
Well, just downloaded uptimistik solution and it looks pretty much the same thing i was doing, just using interpolate insteed of change attribute! Still worth the try!
I sent an project with my solution (which used change attribute) to 3xL and he said that the problem could be that the image was too big! Using dividing the image into smaller ones could help! I still did not had time to test it (i did not had time to anything, lately) but when i do i'll say what worked best!
But overall, it's still wierd that such a simple mechanic is giving so much trouble!
I am giving this a try.