Moving layers

InLikeFlynnInLikeFlynn Member Posts: 171
edited November -1 in Working with GS (Mac)
Say I've got a dozen actors on a background layer and a dozen on a foreground layer. I want all the actors on the foreground layer to move separate from the background when the player touches a certain actor. Is there a way to move a layer separate from the other layers after a rule is triggered?

Comments

  • GamersRejoiceGamersRejoice Member Posts: 817
    I don't think you can do that.
  • InLikeFlynnInLikeFlynn Member Posts: 171
    OK thanks.
  • GamersRejoiceGamersRejoice Member Posts: 817
    Wait, I totally misread your post. I think that would be possible by making a trigger attribute, so if you touch an actor on the foreground layer it deactivates all of the actors on the backround layer and the other way around. Does that make sense?
  • theCodeMonsterstheCodeMonsters Member Posts: 359
    Well depending on how technical you want to be when building your actors, the way I handle this is by giving each actor an individual "ID". Do this by creating a Attribute that will go up every time a new actor is made. When the Actor is made make a self Attribute that will be changed upon creation. Then never changed again. This way is rather technical and may be difficult. But if you're thinking of having these actors spawn this is the route you need to take. I'm sure Tshirt booth has created a really simple way to do this. but this is the way I do it ;)

    ___________________________________________________________________________
    I'm teaching an online programing course go here to find out more!!! http://gamesalad.com/forums/topic.php?id=31505
  • InLikeFlynnInLikeFlynn Member Posts: 171
    GamersRejoice said:
    Wait, I totally misread your post. I think that would be possible by making a trigger attribute, so if you touch an actor on the foreground layer it deactivates all of the actors on the backround layer and the other way around. Does that make sense?

    That does make sense. In another game I made a Real layer attribute for parallax scrolling. I'd constrain each actors position to multiply it's x movement by it's layer, so the higher it's layer attrib the faster it would move.

    The problem is when the scene gets too many actors with each one separately calculate how it should move according to a layer attrib gets expensive. So when I saw you could divide GS scenes into layers I wondered if there was a way to tie actor's movement together on that layer.

    Maybe I should ask, is there a point to having 'layers' besides better organizing groups of actors? Are the only scrolling options scrollable or not scrollable?

    Scrollable and not scrollable seem to treat layers as 2 separate layers, with everything keeping together.
Sign In or Register to comment.