Commit 7b4476f
authored
L10, L11: Fix robot not being moved by move_local_x (#1229)
Previously, when running move_local_x, the robot didn't seem to move.
This happened because the node that was actually receiving the message
move_local_x was the scene root, which was the parent of both Robot and
Camera0D. This means that the Robot was actually moving but the
Camera2D was moving as well.
The fix is basically the same change in both lessons:
- Moved the scene script from the robot to the scene root (in L11 also
removed the Built-in script from the scene root).
- Made the Camera2D top level inside _ready() so its position will be
independent from the scene root, so when the root is moved by
move_local_x, the Robot moves away while the Camera2D stays in place.
Fixes #12281 parent 4fb1ab5 commit 7b4476f
4 files changed
Lines changed: 7 additions & 14 deletions
File tree
- course
- lesson-10-the-game-loop/rotating-and-moving
- lesson-11-time-delta/rotating-and-moving-delta
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
Lines changed: 2 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 6 | | |
17 | | - | |
| 7 | + | |
18 | 8 | | |
19 | 9 | | |
20 | | - | |
21 | 10 | | |
22 | 11 | | |
23 | 12 | | |
0 commit comments