How to change layers when in game?

kinzuakinzua Member Posts: 554
edited December 2011 in Working with GS (Mac)
Okay.. I am in a need of a fix..
M workin on a game, which has the gameplay like Plant vs. Zombie..

Now my heros moves up & dwn the screen..they need to change their layer to seem in front of enemy when move up & seem behind the enemy when move down. Since the actors wont collide with the whole of the enemy, but its core.

Lemme know, if GS has a behavior to control layer order, or if there is a way around.

Thnx.

Comments

  • kinzuakinzua Member Posts: 554
    Instead of gameplay..read camera mode..

    Issue is like, that there is a wall seemin like standin up.. such that its is 64x64.. and collision area as 64x32 on its bottom...same for the actor.

    if i keep the hero below the wall layer.. it seem fine when comin down.. but nt the same when goin up..

    PLzzzzz help.
  • UtopianGamesUtopianGames Member Posts: 5,692
    You cant do layers in GS but some including myself have made workarounds.

    See our Zanda template for an example of what can be done with a different way of thinking.



    Darren.

    GS Templates & Tools + Xmas Bundles
  • kinzuakinzua Member Posts: 554
    Can somebdy suggest a solution. Not really looking forward to buy templates.
  • MotherHooseMotherHoose Member Posts: 2,456
    well we all could suggest things … but what you ask for took a long time to figure out and Darren did the work … so doubt if anyone who does not own the template knows how to do it … those of us who bought the template appreciate all Darren's work and feel it would be unethical to share its features.

    lots of goodies in that ZandaTP … lovely art, some nice sounds/music, and so much good code to reuse/learn!

    it is good you ask for help; with simple things I would be glad to tell you how-to.

    MH
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    edited December 2011
    Well basically you need an identical actor in a layer above and below things you want to move layers. keep them constrained to each other. and then based on the conditions you will change the alpha value of one or the other to 1 and the other to 0 so it appears like its changing layers when really you are just changing which instance is visible.



    Heres a video by darren that shows basically that but no explanation. Hopefully it will help you out
  • kinzuakinzua Member Posts: 554
    Thnx @tshirtbooth. It really helps.. I was working on something like slicing the actor into two and do something..something.. Your idea sounds good..gave me food for thought... Hey darren thanx for sharing, your work is gr8..no offenses, but for me, its 'those' days of the year.... Merry X'mas.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Hope you get it sorted, we also have a free template that will help.

    http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./GSTemplateFR_LAY.html



    Best of luck,

    Darren.
Sign In or Register to comment.