Multiple Height Cliffs 2D tilemap

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rouge_bleu

Hello everyone, I’m new to game dev and godot and I have a first question ! Real quick, I’m searching for the simplest way to have cliffs of different height in a 2D game with godot. (I’m using godot 4 for the new tile map features).

To illustrate what I would love :

  • As in the title : several heights of cliffs (check) (A)

  • My player can go behind with a Y sort (check) (B)

  • If he climbs on a cliff he must be “on top of it” (fail) and not stuck in the texture like in (C)

  • What I would like is the picture (D) which I can obtain by manually changing my player z index above the z index of the cliff1 below, and equal to the z index of the cliff 2.

The solution I was thinking of (but seems kinda complicated) is to index the z value of the player based on the current z index of the tilemap he’s standing on +1

  • z index player = z index of current tilemap + 1

Is this a good idea ? Do you have an idea for such a code ? Is there a way simpler solution ?

PS :

Optional but I would love that too, is there a way to place 32 by 32 tiles on a smaller grid, so I can stack my tiles in the way shown in the optional pannel?

Thank you for you’re time !

can give you an idea for different height.

https://youtu.be/AcXKSYQhYAo

ramazan | 2022-07-27 07:51