How do I control the Z order during gameplay?

Get help using Construct 2

Post » Thu Apr 23, 2015 3:28 pm

Message: vubidugil is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Is there a way to manually set the Z-order of the objects in the game? The only option is to send to the top or bottom? I would like to control intermediate positions in the Z order with the player's actions.

I am using the plugin Rexrainbow, Me helps a lot, but does all the work for me, I would like to know how to control each position of objects during game play.with the plugin Rex, I can sort the enemies and the player perfectly, but when the hero hit an enemy positioned a layer above the player in order Z, I want the enemy to move a layer behind the player, and not go to last position in the Z order of the layout.
B
18
S
4
Posts: 52
Reputation: 1,096

Post » Thu Apr 23, 2015 5:42 pm

Quite simple actually, just use the "Move to Layer" function, and it'll work just fine
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Thu Apr 23, 2015 6:00 pm

if the layout has 10 enemies, I will have to create 10 layers to power he commands them? if you need more objects has not adding layers during game play, but it is possible to modify the Z-order

my doubt is to move objects one level above or below, however the construct 2 only me of the options top or bottom. Expected something of type Set Z >> self Z +2 for example
B
18
S
4
Posts: 52
Reputation: 1,096

Post » Thu Apr 23, 2015 6:21 pm

I don't know if there is a function for that, but you can can try this.

Add a variable to the objects you want to move around to keep the value of the layer he is in.

Every time you update this value, like self z + 2, you will move the character to the layer you want depending on the value you get.

If char Z = 2, move to layer 2. Something like that
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Mon Apr 27, 2015 2:24 pm

I see something that may be what you are looking for...

Move to object
Move the object next to another object in the Z order. You can choose to place the object to be placed in front or behind another object. If the target object is on a different layer, the object will also be moved to the target object's layer and then Z ordered next to it.

It is under the zorder actions, maybe it is a limitation on the plugin.
B
6
S
2
Posts: 15
Reputation: 589


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests