daniu54 / earie-treasures

A 2d top-down loot-em-up with horror and stealth elements
0 stars 0 forks source link

Name collision layers and masks project-wide #78

Open Abb4 opened 1 year ago

Abb4 commented 1 year ago

in #69 I moved player, enemy and level to different collision layers. I chose the values arbitrarily. This makes it hard to reference in code. We can document which entities go on which layers by specifying layer names in the editor. These should be reflected in editor UI and make it easier to keep track.

See how to name layers here: https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html#collision-layers-and-masks

Bonus points if you research if it is possible to reference layers by name from code. It will probably be annoying to construct them from code, like it is shown here.

Abb4 commented 1 year ago

In #69 (commit) defined collision layers as follows:

See root nodes

Abb4 commented 1 year ago

In #11 defined (player) interaction as layer 17