Scrolling background not using scene wrapping??? Please help!!!

KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
edited February 2012 in Working with GS (Mac)
Hello all,
Now I know I am able to put scene wrapping in the scene but I don't want that. I only want the background to scroll and wrap. What would be the best way to go about putting wrapping on a background or specific actor without using the scene wrapping? Thanks in advance!

killerpenguins :-??

Comments

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @tshirtbooth or anyone else
    Do you know how to go about doing this or if there's a video tut?

    Thanks!
  • UnicornInvasionUnicornInvasion Member Posts: 301
    @killerpenguins Like an actor moves out of the scene then comes round the other side without wrapping the scene?
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @Unicorninvasion
    Yes, I know I can give it a rule that says when it's self.x is </= -240 change attribute self.x to 720. This would be fine and work great for a regular actor but I need it for my background so it can wrap fluidly the whole time and without me putting on scene wrapping.
  • UnicornInvasionUnicornInvasion Member Posts: 301
    Why can you not use WrapX/WrapY and just put walls so nothing else falls out? Provide a video if you can!
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @Unicorninvasion
    I am trying to change my Dolphin Escape game around. Right now I have wrap X checked so it does wrap. But the issue with this is that everything in the scene then will wrap. So I have to tell each of my actors to destroy it's self before it reaches 0 because it will just wrap if I don't. I only want the background images to wrap. and that's it. Didn't know if maybe I turn on wrap X if you could make wrap X false on everything you did not want to wrap.

    Hopefully this is more clear and thanks!
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    Do this: Rule - when self.position.X < 240 then spawn actor (background actor) at self.position.X+240.

    This will make it so the actor is moving left, and when the actor moves past 240, then spawn the same actor 240 pixels to the right. Just make sure that you make another rule under this one that destroys this actor once it reaches past the screen to the left. That way you won't bog down the system when you spawn tons and tons of the background actors.
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    Also, if you want to stack backgrounds, make sure to slow down the speeds as you go back in scene distance. like mountains in the back moving at a slower pace then the trees in the foreground.
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @poopdecksweeper
    Thank you for your response! I have tried this but it is not fluid. I am not able to get it to where it will scroll smoothly together as if it were wrapping.

    Thanks,
    killerpenguins
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    if you want me to try I can. Just send the file and I will try to make it parallax.

    paulotzky@clearskiesahead.com
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Thank you guys for your response. @poopdecksweeper - Let me look at the video tshirtbooth posted. Right know what I did was I made a 6 frame background animation and it's not 100% clean like the wrapping is but is works. And for right now my FPS are between 59 and 61 so still good. I will let you know either way. Also, thank you tshirtbooth I will take a look and see how that works and let you know!

    Thanks
    killerpenguins
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @tshirtbooth
    First I would like to thank you for taking the time to post this and help me out. It is GREATLY appreciated! I would like to say that I did the very thing you have and it doesn't work right. It ends up lagging a bit and puts a gap between the two images (showing a black line) and this is due to the speed I am needing the background image to go at. If I left the speed at -90 then all is fantastic :-bd but I am needing it to scroll at -200 and that is where it is causing the problems as stated above. For now I am trying out making the scrolling background a 6 frame animation and it's working out okay.

    Just a little side note, Since the scene wrap is a boolean and if I made it true, I wish you could do a change attribute, select scene, sleect wrapping and put it to false or they should have wrapping as a attribute to put on an object. I think if they added that,that would be AwEsOmE SaUcE!!! Just felt like throwing that out there.

    Again thank you all for your help!

    Thanks,
    killerpenguins
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    @killerpenguins

    "It ends up lagging a bit and puts a gap between the two images (showing a black line)"

    Just make sure the images overlap a little - a soft edge helps the blend.
  • CloudsClouds Member Posts: 1,599
    [EDIT] beaten to the point by tshirtbooth . . . .
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Yes, I did try that also but with the speed of of the images and it lagging a split second it spaces them out. In the demo you provided, I replaced the -90 in the change attribute self.Motion.Linear Velocity.X to -200 and it did in fact put the gap between the two images. I even tried making the images wider than what was in the demo so they overlapped more but over a little bit of time, they end up spacing apart. It is even worse when it is in the actual game because there is a lot more going on and it lags more. Thanks again for all your help!

    Thanks,
    killerpenguins
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Just so it's clear, I have done and tried what you guys have been saying plus more. If I needed the background to have a speed of -90 or -100 than this works perfectly and great. But since I am needing the background to move at a speed between -200 to -300 that is where is is causing the issues. Even by making them wider so they overlap mare, over time it does space them out. Thanks again guys!

    Thanks,
    killerpenguins
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @tshirtbooth
    umm, I am a little confused with this. Why am I wanting to try int at a speed of 2000? It still does it and it is way to fast for what I want. LOL
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    lol, It's a 2.4 GHz Intel Core 2 Duo with 8 GB of RAM
    But I think you may be onto something about this. I decided to run the background at -200 and test in on my iPod touch and has not had any issues with it spacing apart. I am going to try it out for a little bit but I may just stick with the animation I created just in case!

    Thanks,
    killerpenguins
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    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!
  • famekraftsfamekrafts Member, BASIC Posts: 834
    I am having similar problem for my ipad game.

    I am making it spawn instead of moving the position. That was working fine till the time when turning the player sprite into another player sprite, I need to pause everything for a second, this changes an attribute. As that attribute changes back to zero again, they start respawning.

    This cause more than one sprite to spawn on top of one another and by the third change there are over 4-5 backgrounds on top of one another.

    How do I pause spawning of an actor?

  • famekraftsfamekrafts Member, BASIC Posts: 834
    I tried @Tshirtbooth 's both samples but its not working, maybe because I am doing it for ipad and getting the coordinates wrong or because my processor is just too fast. I am using 12 gb ram, i7 quad core processor.

    So I think I will have to use the spawn option, but once I pause it for a second the position starts overlapping with the new spawns.

    I also read its not memory efficient to keep spawning and destroying actors, so what exactly I should do?
  • vigomatvvigomatv Member Posts: 2
    I used Tshirtbooth's solution, it works very well if I keep my game configuration as Legacy iPhone Land Scape. If I change it to new iPhone configuration the issue of gap arises.

    Has anyone found any solution yet?
  • mrpacogpmrpacogp Member Posts: 400
    Are you using tiles?
  • CORE GameCORE Game Member, PRO Posts: 280
    what I made for my game is the following:
    1- created 1 actor, with the background image.
    2- The image I used is matching from boths sides (top and bottom) since I wanted the image to move from bottom to top.
    3- Added a beheviour to "Move" to top.
    4- Added a rule, to go all the way to the begining of the scene Y = 0, if it reach to the end of the camera (top).
    5-placed the actor twice in the middle of the view (and made sure that I made them close to each others (touching the bottom of the first actor is touching the top of the second actor).

    The actors will move to the top following each others, when it reaches to the point where its out of the scene (Step4) it will reset the position to go all the way down the bottom of the scene.

    Let me know if it works with you.

Sign In or Register to comment.