How to make Y-Sort mountain in a 2D game?
Asked Answered
C

2

0

The mountains in my game are made from tilesets, so I can easily make them in a short time.

But I have a question: how do I get the player to walk behind the mountain?

Currently, the land on the mountain is on the same level as the land below the mountain, and the mountain is more like an edge, and I added collision to the edge. But if I want the player to be able to walk behind the mountain, this becomes very difficult.

So how do you handle mountains in a 2D top-down game?

Contagion answered 1/3 at 9:37 Comment(0)
R
0

A combination of Z index and Y sorting.

Raceway answered 1/3 at 14:11 Comment(0)
Q
0

Contagion how they do it in RPG Maker is they usually make an event that has different layering than the rest of the tilemap. You could make a separate Node2D that is on a different layer, then put your mountains there. Adjust the z-layer and bam. You may want to make an alternate tilemap with different physics for the mountain you go behind.

Alternatively, you can just make some Sprites with the mountains, place them where the player "goes behind."

Layering is your friend. Talk sweet nothings into its ear.

Quimby answered 2/3 at 0:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.