Parallax background disappears

Hello all,
I'm currently working on a game for a college project
What I need for an A is a Parallax background effect, which I have achieved by having 3-4 different layers of background, their X attributes controlled by the scenes camera origin using this mathematical formula:
Constrain
Self.positionX to -scene.camera.origin/n (n being the speed I want)

This works brilliantly, it's a very nice effect. But it dissapears towards the end of the scene, it'll be cut off so the tiled graphic will stop then vanish, the scene is 4000 pixels in width and the graphic is 9000 (we tried smaller numbers and higher numbers but they always cut off then vanish) can Gamesalad not handle this? even with the graphic at a slower speed it always cut off at about 3800 pixels give or take.
The graphic in size i very small, an optimized PNG. So I wouldn't think data would be an issue.
The weird thing is when we used to two bits of code in the actor (parallax one) that instead made it move by accelerating depends which direction you're going in, and they were turned off, once published the parallax worked fine... I really don't understand this lo

Comments

  • JDuaneJJDuaneJ San Francisco Member Posts: 300
    edited March 2014

    Here is a nice vid on parallaxing, https://youtube.com/watch?v=-w_zCRTsXFg. If you are saying it works when published but not in the preview? Do you have wrapX/Y checked?

    Also check here forums.gamesalad.com/discussion/17438/parallax-background

  • protodethprotodeth Member Posts: 6

    Thank u for the reply
    But none of these links help, I haven't got wrap x and y ticked, it breaks them game.

  • BBEnkBBEnk Member Posts: 1,764

    There other ways to do this but in your case what may be happing is your image is moving to the left and the center is actually getting of the screen past -508 which causes it to destroy so try making your image even bigger and move it further to the right so by the time you get to the end it's still within -500.

  • protodethprotodeth Member Posts: 6

    I'll give that a go, thank you :)

  • protodethprotodeth Member Posts: 6

    Thank you very much for your help, worked like a charm :)
    What I ended up doing thanks to your information is changing my mathematical formula from: -camera.orgin/n to: 2000-camera.orgin/n
    and that did the trick :)

Sign In or Register to comment.