Parallax Effect / Layered Backgrounds

NobulaNobula Member Posts: 2
edited November -1 in Working with GS (Mac)
I haven't figured out how to search the forums so forgive me if this is answered already. Does GameSalad allow creators to have "layered" background or create multiple depths for Parallax effects?

If so, can someone point me in the right direction? Many thanks.

-n

Comments

  • xactoxacto Member Posts: 146
    Not sure if there is an example here yet... however, it should be pretty easy to do this. One way is to create 3 actors (or how many depths you are looking for) as transparent PNG and then drag the "move" behavior and enter a different speed for each actor. Make sure fixed rotation and Movable Physics are on.

    Come to think of it, I believe that the "Basic Shoot Em Up" template does something like this... check out how the "Ground", "Sunset" and "Planet" graphic are treated. Very simple.
  • NobulaNobula Member Posts: 2
    Thanks xacto, these solutions should work well!

    It would be nice to have background "actors" separate from movable ones... but by no means is this something worth looking at until all their other functions and features are implemented.

    -n
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Check out the http://gamesalad.com/wiki/scene_layers wiki. That may help with the layers.
  • bladeolsonbladeolson Member Posts: 295
    Code Monkey? The link is broken here. But I am interested in this scene layers topic. Any clues?
  • PhoticsPhotics Member Posts: 4,172
    I haven't done this yet, but I think parallax scrolling would be something like this...

    Create a game variable... Speed

    Rule for actor - If Right Arrow Down, Accelerate toward 0° at (speed)
    Rule for background - If Right Arrow Down, Accelerate toward 0° at (speed)
    Rule for far background - If Right Arrow Down, Accelerate toward 0° at (speed)/2
    Rule for really far background - If Right Arrow Down, Accelerate toward 0° at (speed)/4
    Rule for foreground - If Right Arrow Down, Accelerate toward 0° at (speed)*2
  • bladeolsonbladeolson Member Posts: 295
    that is awesome. I think that helps a lot. I just need to figure out how to make those background small enough. That part kind of tweaks my mind.
  • JohnGreenArtJohnGreenArt Member Posts: 19
    Photics' logic will work in some cases, but there are times it may not work. For example, if your player character can bump into walls. The player could face a wall and accelerate into the wall. They wouldn't move because the wall is stopping them, but they could still have the accelerate key down, so the background would continue to move. To fix this you'd have to make sure the "speed" variable in Photics' example is tied to the actual speed of the player, not just if the acceleration key is pressed.

    There are other ways to pull off the parallax effect, just finding which way is appropriate for the type of game you have can be the hardest part.
  • PhoticsPhotics Member Posts: 4,172
    Heh... I didn't try it yet. It was just a guess. :)

    Maybe a constrain (with a multiplier/divider) to self.Motion.Linear Velocity.X would work better.

    Again... I haven't tried that yet either. I'm supposed to be making my first iPad app right now. :)
Sign In or Register to comment.