How to make a LONG sidescroller background? o_O

WolfieEnsaladaWolfieEnsalada Member Posts: 26
edited November -1 in Working with GS (Mac)
Hey everyone! :D So I've been working on this game which is basically supposed to work like a sidescroller. When you tap the screen, the character jumps to avoid obstacles. It sounds pretty simple, but since I've just started using GameSalad, it's been fairly difficult to figure out how to make it. xD

My main problem right now is that the background is supposed to scroll by as the character runs, but the dimensions of this background are 90000 x 320, so it's been next to impossible to find an appropriately sized image for it. XD I tried making a gradient image with Photoshop and Acorn, but both times the programs crashed due to the oversized dimensions.

So, my question is... is there any way to add in a background image that can fit this? Maybe by tiling one image over and over again? (Although when I tried doing that I ended up having to drag in the background actor 90 or so times, don't want to go through that again. xD) Any ideas? Or is there a special behavior or attribute I can use to help with this?

Comments

  • AfterBurnettAfterBurnett Member Posts: 3,474
    You can use smaller pics up to 1024x1024 side by side or you can use one actor with a smaller graphics tile. The actor can then be stretched to ANY size - just make sure you have the graphics attribute set to tile, not stretched or fixed :)
  • skippyskippy Member Posts: 106
    My scene size is 20,000 x 320 and even though i could make a graphic that big in gimp gamesalad wouldn't accept it, i even tried 5000 x 320 to use 4 of them to make 20k but still no good so i used 2000 x 320 and used 10 of them and its fine and what i have learned in these great forums is what u need to do is create a constrained actor thats a bit bigger than the screen say 320 x 500 or 510 and everything is activated when it collides with that constrained actor so for eg you have your 90k scene and fill it with all your actors but none of them move or spawn or activate or do anything untill you reach them with your contstrained actor which is in front of your main actor/character, hope this helps
  • HachikoHachiko Member Posts: 330
    Can't you make an image 480x320, set it in a layer non scrollable so that it will always follow the camera?
  • skippyskippy Member Posts: 106
    I tried that but it didn't work seems like it can't collide with actor's in another layer, like your HUD can't collide with things on screen, i think anyway maybe i'm doing it wrong but if you know it does work let me know i could save another constrained actor.
  • HachikoHachiko Member Posts: 330
    Maybe I understood wrong, but if it's for the background image, you can just put it in a non scrollable layer. For everything else, you can put it in a scrollable layer. To make them move just when you want they are near the screen, just put a rule that says "only when self position X is greater than camera origin and less than cameraorigin+480 (or the width of the camera you are using), than do that and that and that too.
  • skippyskippy Member Posts: 106
    Oh i see (month's ago i followed someone else's advice) i put a rule on all my movable actor's when actor collides with invisible actor (the constrained one 320 x 500 ) then do whatever they do just before they come into view, would your way be better or is it much and muchness you think ?
  • HachikoHachiko Member Posts: 330
    My way should be better. No actor and you don't have to rely on gamesalad collision, that not always work. Mine works with instances, so you gotta click on the actor you put on the scene, unlock it and make the rule from there. Then, if you want to use it in prototype actor, you can always put that rule on the My behaviour tab, then go to the prototype of that actor and put that rule in there. It will not look right, you'll see only scene instead of scene.camera.origin.X. But it will work anyway.
  • WolfieEnsaladaWolfieEnsalada Member Posts: 26
    Hmm... these are all good suggestions, I'm mainly focusing on what POLYGAMe said earlier about setting the graphics attribute on the background actor to tile... do you have to set both the horizontal and vertical setting to tile for this to work, or just one of these two, leaving the other stretched? o_O
  • HachikoHachiko Member Posts: 330
    both it's ok. than after you have put that in the scene, you stretch it for all the width of the scene. Don't know how though it can be over the framerate.
  • WolfieEnsaladaWolfieEnsalada Member Posts: 26
    Thank you Hachiko! ^__^ Now I just need to get an image. :D Thanks everyone. lol.
  • WolfieEnsaladaWolfieEnsalada Member Posts: 26
    =( Now I have ANOTHER problem. I found a background image and did the tile thing like POLYGAMe suggested and Hachiko helped with, but now it won't scroll. xP I've tried adding behaviors and attributes like "Control Camera" and "Accelerate", but none of these have been helping. I'm assuming the problem is with my layers, which are set up as such. The main character's name is Blaze.

    Blaze (nonscrollable layer)
    > Blaze

    Background (scrollable layer)
    > Forest

    Other Background (nonscrollable layer)
    > Ground (for gravity rule)

    So each actor is in a different layer, which is probably wrong. What should I change to make the background scroll? o_o
  • HachikoHachiko Member Posts: 330
    The thing is, scrollable actors can't collide with nonscrollable actors.
    So, if you put blaze in a nonscrollable layer, the ground must be in the non scrollable layer, or else blaze would fall, not touching it. Therefore, the ground will not scroll. Just the forest.
    If even the forest do not scroll, try to put some actors in a scrollable layer in the scene, away from the camera. If I remember correctly, the camera do not scroll until there's something scrollable ahead.
  • WolfieEnsaladaWolfieEnsalada Member Posts: 26
    Hmmm.... okay, I'll try this. I hope it works. *crosses fingers*

    EDIT: I fixed the layers, but the background still won't scroll. Should I apply an attribute or behavior to the background? Right now the only ones applied to it are the "Resume Music" and "Change Scene" ones, which don't have anything to do with scrolling, but when I use "Accelerate" or "Accelerate Towards" it doesn't work. o_o

    EDIT 2: Wait, I'm gonna try the thing with the scrollable actors ahead and see if it works. xD

    EDIT 3: Nope, that didn't work either. D= The layers are like this right now:

    Blaze (non scrollable)
    > Blaze

    Background (scrollable)
    > Forest

    Ground (non scrollable)
    > Ground

    I have a feeling this doesn't have anything to do with the layers, but maybe a glitch in GameSalad now. o__o" Those layers should be working! But then again, it could be something I'm doing wrong. xP
  • HachikoHachiko Member Posts: 330
    Thing is, who is the one that is controlling the camera? °° It can't be blaze, because she is non scrollable. Without someone scrollable controlling the camera and moving, the camera won't move, and everything won't scroll.
  • WolfieEnsaladaWolfieEnsalada Member Posts: 26
    The background is controlling the camera, (Forest), but it still isn't scrolling. =(

    EDIT: All right, I figured out the scrolling issue actually. xD Basically, what I had to do was apply the "Move" behavior to the Forest background and make the Forest actor "Movable" under Physics so that way it moves.

    Unfortunately I now have another problem. xD Now the background scrolls, but it stops at a certain point and just starts... spazzing out? Like it moves from side to side really quickly and gets stuck. o__O I have no idea why this is. Anyone else have this problem?
  • HachikoHachiko Member Posts: 330
    Well, that's because, if it's the forest that control the camera (you put a move or accellerate behaviour to it?) how can it scroll? If it control the camera, the camera follow it! then, it won't scroll. You should put it in another scrollable actor, with a movement to the right, to see the forest background scroll :)
  • WolfieEnsaladaWolfieEnsalada Member Posts: 26
    Hachiko said:
    Well, that's because, if it's the forest that control the camera (you put a move or accellerate behaviour to it?) how can it scroll? If it control the camera, the camera follow it! then, it won't scroll. You should put it in another scrollable actor, with a movement to the right, to see the forest background scroll :)

    Thank you so much! You helped solve my other problem. xD I shouldn't have added the Control Camera behavior to the Forest, since that causes it to spas out. ^___^ You were really helpful, Hachiko! Thanks a bunch! :D And thanks to everyone else on here too who helped answer these annoying questions. xD
  • HachikoHachiko Member Posts: 330
    No problem, glad it helped :) Good luck with your game, and if you need something, just ask :)
Sign In or Register to comment.