I never know that this is possible before aside from using parentheses. Is this mention anywhere in documentation? I think I read style guide many times and never know this or did I miss it ?
Ah, I never know that using black-slash can allow continue statement in new line in GDScript.
Is this mention anywhere in documentation?
It is in the latest
branch (and 3.4
too): https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_basics.html#if-else-elif
I just cherry-picked this to the 3.3
and stable
branches – it'll appear in the live documentation in an hour or so.
@Calinou said:
Is this mention anywhere in documentation?
It is in the
latest
branch (and3.4
too): https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_basics.html#if-else-elifI just cherry-picked this to the
3.3
andstable
branches – it'll appear in the live documentation in an hour or so.
Oh, so it is just newly add in docs.
I've been using the backslash-line-continuation feature for a long time, so I must have seen it somewhere.
That link pointed out an aspect of the feature that I wasn't clear on. When there's an open delimiter (parenthesis, bracket, brace), the backslash isn't needed.
Real men write the whole game with one line of code.