Parallax scrolling issues with iPad

poopdecksweeperpoopdecksweeper Member Posts: 180
edited January 2012 in Working with GS (Mac)
Hello all,

I have a little problem with my backgrounds scrolling in my iPad game. The iPad version of my game will only spawn a new background actor (that is constantly moving left) once the first background actor's last pixel reaches the halfway mark of the screen, yet I made the rule that states that "when attribute: self.position.x < -1 then spawn actor :self.position.x+1024" (Of course the background image is 1024).

I know that I have not wrote down all of the rule, but I know that it is right because my iPhone game works perfectly. All I did to make the iPad game was to resize images and redo rules to match those changes.

Is there a bug in the iPad preview part of gamesalad? Any help would surely be appreciated.

Thanks,
Poopdecksweeper

Comments

  • CloudsClouds Member Posts: 1,599
    Why not just get rid of the 'spawning' behaviour and use a single background image moving from right to left - with the scene attribute 'Wrap X' switch on ?
  • CloudsClouds Member Posts: 1,599
    P.S in your iPhone version do you just let the background carry on moving to the left once it has left the screen or do you have a rule that destroys it once it has left the screen ?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    the x position of the actor is figured from the center of the actor. So if you want to make a rule like that

    you meed to have it trigger when the actor x<512 and spawn the new one at something like X=1532 though that will destroy your games performance and you should look into recycling or using wrap x on the scene.

    Cheers
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    I thought about wrapping X on the scene, but I have actors that spawn and move towards you on the x-axis. I don't want them to wrap as well. I tried what you said to do Tendrmer, but it is not working. The background actor doesn't spawn when you put the trigger at x<512.

    Also, Tynan, I destroy the actor once it has moved past where you can see it. So at like 1024 I destroy.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    it doesn't spawn at all?
    Something else is wrong in your code if thats the case.
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    Yea it doesn't spawn at all when I place the spawn point at 512 pixels. It is really weird and I am having the hardest time trying to figure it all out.
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    Still no dice. Any other suggestions?
  • bluebyu25bluebyu25 Member Posts: 500
    Make sure you aren't using the "move" behavior. Use change velocity. Haven't read all your thread but that will make a difference.
  • poopdecksweeperpoopdecksweeper Member Posts: 180
    It doesn't really make a difference in what i've been trying. sorry. Is there a way to make the scene background wrap, but not the actors within that scene??
Sign In or Register to comment.