Skip to content

Commit 6f2428a

Browse files
committed
Added documentation comments
1 parent 099a7dc commit 6f2428a

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

gdscript/documentation_comment.gd

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
extends SceneTree
2+
## This is a documentation comment that this file is
3+
## about documentation comments.
4+
5+
signal die ## Inline documentation comment where you can signal if the player died.
6+
7+
## This variable stores the health of the player.
8+
var health = 45
9+
10+
## This variable below is depracated. Stores item count.
11+
## @depracated: Use
12+
var items = ["helmet", "sword", "shield"]
13+
14+
## This below is a vector of some kind, maybe you can take
15+
## a look here for more information about Vector2.
16+
## @tutorial: https://docs.godotengine.org/en/stable/classes/class_vector2.html#class-vector2
17+
var vector = Vector2()
18+
19+
## This function below makes the player do a dance move,
20+
## however this feature is experimental.
21+
## @experimental
22+
func do_a_dance(dance="dab"):
23+
print("Player %s" % dance)
24+
25+
## This documentation tag is super long because Undalevein wrote me
26+
## this was and it is super wordy to the point of nonsensical but I
27+
## guess run-on sentence is overrated like sheesh I know that
28+
## sometimes sentences can be long but being this long is extremely
29+
## masochistic and just not ideal for an example like this.
30+
## [br]
31+
## Anyways, we just did a line break and now I am going to do
32+
## another line break right now to explain what this function is
33+
## below.
34+
## [br]
35+
## This function only prints "Hello"
36+
func hello():
37+
print("Hello")

gdscript/test.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ godot --display-driver headless --no-header -s "$PSScriptRoot\clockhands_time.gd
2020
Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") |
2121
Assert-MatchTests &&
2222
godot --display-driver headless --no-header -s "$PSScriptRoot\code_regions.gd" &&
23+
godot --display-driver headless --no-header -s "$PSScriptRoot\documentation_comment.gd" &&
2324
godot --display-driver headless --no-header -s "$PSScriptRoot\fibonacci.gd" &&
2425
godot --display-driver headless --no-header -s "$PSScriptRoot\file_reader.gd" "$PSScriptRoot\..\test\carrots_expected" |
2526
Compare-Object (Get-Content "$PSScriptRoot\..\test\carrots_expected") |

0 commit comments

Comments
 (0)