Skip to content

Commit d94ac5b

Browse files
committed
Wrap longer code lines to avoid too much overflowing and scrollbars
1 parent db33509 commit d94ac5b

5 files changed

Lines changed: 51 additions & 11 deletions

File tree

course/lesson-19-creating-arrays/moving-turtle/MovingTurtle.gd

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,19 @@ onready var units: Dictionary setget set_units
1414
var _label_container := Control.new()
1515

1616
# EXPORT path
17-
var turtle_path = [Vector2(1, 0), Vector2(1, 1), Vector2(2, 1), Vector2(3, 1), Vector2(4, 1), Vector2(5, 1), Vector2(5, 2), Vector2(5, 3)]
17+
# Note: Putting each vector on a
18+
# separate line is just for
19+
# readability. It's optional.
20+
var turtle_path = [
21+
Vector2(1, 0),
22+
Vector2(1, 1),
23+
Vector2(2, 1),
24+
Vector2(3, 1),
25+
Vector2(4, 1),
26+
Vector2(5, 1),
27+
Vector2(5, 2),
28+
Vector2(5, 3)
29+
]
1830
# /EXPORT path
1931

2032
onready var turtle := $Turtle

course/lesson-19-creating-arrays/selecting-units/SelectingUnits.gd

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ onready var turtle := $Turtle
2121
func _ready() -> void:
2222
_label_container.show_behind_parent = true
2323
add_child(_label_container)
24-
set_units({
25-
Vector2(1, 0): $Robot,
26-
Vector2(4, 2): $Robot2,
27-
Vector2(0, 3): $Robot3,
28-
Vector2(5, 1): $Robot4,
29-
})
24+
set_units(
25+
{
26+
Vector2(1, 0): $Robot,
27+
Vector2(4, 2): $Robot2,
28+
Vector2(0, 3): $Robot3,
29+
Vector2(5, 1): $Robot4,
30+
}
31+
)
3032

3133

3234
func _run():
@@ -37,7 +39,15 @@ func _run():
3739

3840
# EXPORT run
3941
func run():
40-
select_units([Vector2(1, 0), Vector2(4, 2), Vector2(0, 3), Vector2(5, 1)])
42+
# Note: Putting each vector on a
43+
# separate line is just for
44+
# readability. It's optional.
45+
select_units([
46+
Vector2(1, 0),
47+
Vector2(4, 2),
48+
Vector2(0, 3),
49+
Vector2(5, 1),
50+
])
4151
# /EXPORT run
4252

4353

course/lesson-20-looping-over-arrays/drawing-in-loops/DrawingInLoops.gd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ func _run():
1010

1111

1212
# EXPORT draw
13-
var rectangle_sizes = [Vector2(200, 120), Vector2(140, 80), Vector2(80, 140), Vector2(200, 140)]
13+
var rectangle_sizes = [
14+
Vector2(200, 120),
15+
Vector2(140, 80),
16+
Vector2(80, 140),
17+
Vector2(200, 140),
18+
]
1419

1520
func run():
1621
for size in rectangle_sizes:

course/lesson-20-looping-over-arrays/robot-path/RobotPath.gd

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ func _ready() -> void:
1818

1919

2020
# EXPORT run
21-
var robot_path = [Vector2(1, 0), Vector2(1, 1), Vector2(1, 2), Vector2(2, 2), Vector2(3, 2), Vector2(4, 2), Vector2(5, 2)]
21+
var robot_path = [
22+
Vector2(1, 0),
23+
Vector2(1, 1),
24+
Vector2(1, 2),
25+
Vector2(2, 2),
26+
Vector2(3, 2),
27+
Vector2(4, 2),
28+
Vector2(5, 2),
29+
]
2230

2331
func run():
2432
for cell in robot_path:

course/lesson-23-append-to-arrays/popping-crates/PoppingCrates.gd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ func _restore_next():
5656
_initial_crates[index].reset(3)
5757

5858
# EXPORT run
59-
var crates = ["healing heart", "shield", "gems", "sword"]
59+
var crates = [
60+
"healing heart",
61+
"shield",
62+
"gems",
63+
"sword"
64+
]
6065

6166
func run():
6267
while crates:

0 commit comments

Comments
 (0)