Positioning and a scrolling background

jbsitedesignjbsitedesign Member Posts: 25
edited November -1 in Working with GS (Mac)
Hello,

I have a game where it is fine for a background to repeat but i do not want to use wrapping as i would like there to be more variety to the background that is repeating than 480 width allows. I have ALMOST managed to accomplish this with a 1024 x 256 background actor. i position the actor so that its left edge is lined up with the left edge of the screen and it moves with a constant velocity to the left. when the backgrounds right most edge reaches the rightmost edge of the viewable area it will spawn another of itself. when the right most edge of the background reaches the left most edge of the screen it will delete itself so as not to make a lot of copies in memory. HERE IS THE PROBLEM. in order to get the 2nd instance of the background prototype to line up correctly with the rightmost edge of the screen when it is spawned it must take an X position of 992 exactly (width /2 + screenwidth). seems simple enough. WRONG. at any setting > 979 it just will not work at all and the spawned background actor never appears to the screen. at 979 it will function as desired except for the fact that the 2 backgrounds are now overlapping and are quite obvious to the eye as 2 pieces. Is there some kind of offscreen position limit for actors? or do you have any other ideas or tips that may be causing this strange and annoying behavior?

Comments

  • jbsitedesignjbsitedesign Member Posts: 25
    no one ?? it might be easier just to write my own engine in obj C i guess...thanks but no thanks game salad
Sign In or Register to comment.