akien-mga / dynadungeons

Bomberman clone using Godot Engine - Not actively developed since 2015.
GNU General Public License v3.0
217 stars 37 forks source link

Refactor the scene structure of the project #20

Closed ghost closed 9 years ago

ghost commented 9 years ago

As per issue #18

Sorry, I got a bit carried away with my commit, so it's pretty bulky. Will make sure subsequent commits are broken down better.

akien-mga commented 9 years ago

Looks good to me, and it works with current godot-git.

akien-mga commented 9 years ago

Thanks a lot :)

ghost commented 9 years ago

No problem at all :)

Just responding to your points:

get_tree().get_root().get_node("child/child/child") vs get_node("/root/child/child/child")

Up to you though :)

akien-mga commented 9 years ago

No preference either between get_tree().get_root() and get_node("/root"). In saying that, we probably should stick to one way of doing it, and get_node("/root") would make for less typing, especially when you need to jump through many levels of nodes:

Yes, I personally went for get_node("/root") because it makes for less encapsulation; after playing around with VBA during an internship, I'm not so fond of overly encapsulated APIs :P

Let's go with get_node("/root") then, since as you say it can also be easily extended to get_node("/root/child") if need be. Keeping lines short is especially important in a language where indentation is done with tabs IMO, as it's hard to align stuff properly on several lines :)

ghost commented 9 years ago

Sounds good. I'll make the format change on my next commit :)