Event with layers

0 favourites
  • 5 posts
  • Hello

    I was wondering if it would be posible to effect objects, depending on wich layer they are.

    Theres already an action that makes it posible to move the object to different layers so I think this combination would be nice.

    I have noticed that layers sofar got more function just for visual organization and parallax effect but it would be nice to have an condition like, If player is on layer1, make this solid object on layer2 inactive, or prevent overlap or conllisions.

    I could imagine using this for example for enemy ambushes where the enemy is in the bg and can hit the player only when they are in the same layer.

    Or a puzzle like adventure game where the player can get to the platform in the bg for extra treasure and evenrything in the foreground wont effect the player, especialy the solid objects.

  • I'll see if I can add an 'is on layer' condition in a future build.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Miu3, this can behavior can also be performed with events, as such:

    OnLayer Example

    Assuming this is the behavior you're looking for.

  • It can be done with variables, by assigning a variable to a player (let's call the player Hero, and the variable myLayer).

    System -> every tick: Hero.myLayer = Hero.LayerNumber

    Keyboard -> onKeyPress(1): Send Hero to layer 1


    Keyboard -> onKeyPress(7): Send Hero to layer 7

    IF Hero.myLayer == 2, do.this

    So it's possible, but just a little roundabout.

  • Thankyou, the ideas are very helpful :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)