How do I automate the Z order for my trees?

Get help using Construct 2

Post » Thu Nov 03, 2016 3:23 am

In my game, I want the trees up the top at the bottom of the layer & down the bottom at the top of the layer
Thanks! :D
Image
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
33
S
12
G
3
Posts: 38
Reputation: 4,542

Post » Thu Nov 03, 2016 3:26 am

Well, you can simply add an action "Move to top" or "Move to bottom".

If you happen to use layers, order them appropriately.
You can also create extra layers for trees and order them how you want.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Thu Nov 03, 2016 3:29 am

The problem is all the maps are randomly generated & there can be lots of trees in a forest zone.
Thanks for your response :)
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
33
S
12
G
3
Posts: 38
Reputation: 4,542

Post » Thu Nov 03, 2016 1:21 pm

Well okay then.

Go with the layer option then.
Create two layers, one for the top trees, one for the bottom trees.
Move the top layer to the top in the z-order and the other layer to the bottom.

Now, each time you create a tree, you can select on which layer it should spawn.
Choose the appropriate layer and you're done.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Thu Nov 03, 2016 3:52 pm

On layout start (or after all trees generated)
-For each tree ordered by Tree.Y ascending
--move to top of layer

Trees don't move so should only have to do it once
ImageImageImage
B
39
S
22
G
11
Posts: 492
Reputation: 9,925

Post » Thu Nov 03, 2016 11:56 pm

Thanks! :D
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
33
S
12
G
3
Posts: 38
Reputation: 4,542


Return to How do I....?

Who is online

Users browsing this forum: ChesVCF, LaDestitute, OBLIVION, yiuyiu6666 and 25 guests