Scrolling background not using scene wrapping??? Please help!!!
KillerPenguinStudios
Member Posts: 1,291
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 :-??
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
Do you know how to go about doing this or if there's a video tut?
Thanks!
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.
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!
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.
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
paulotzky@clearskiesahead.com
Thanks
killerpenguins
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
"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.
Thanks,
killerpenguins
Thanks,
killerpenguins
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
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
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?
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?
Has anyone found any solution yet?
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.