Commit a4a4992
authored
Do not assume class of first node in group player (#2369)
So cinematics can assign "player" group to the mock player sprite.
This makes the dialogue balloon to appear at the top of the screen when
the
sprite is at the bottom.
### Do not assume class of first node in group player
Certain scripts could treat player as a CharacterBody2D for physics,
as a Node2D for its position, or as a CanvasItem for visual stuff, etc.
Input HUD: It considers the player a CharacterBody2D and checks for its
components using `Object.get(COMPONENT_NAME) as COMPONENT_CLASS`.
Previously it
was assuming that the output of `get_first_node_in_group()` was a
CharacterBody2D. The assignment would fail if the first node in group
"player"
is of another type. This doesn't allow mock players, for example an
AnimatedSprite2D in a cinematic.
Throwing enemy: All this enemy needs is the global_position of player
for
throwing. This makes it closer to the ThrowProjectileBehavior which has
`@export
var target: Node2D`. Also get the player node from group "player" only
once.
player_follower.gd: All this script needs is the global_position of
player
for calculating the offset.
----
Fix #23061 parent 05c160f commit a4a4992
28 files changed
Lines changed: 33 additions & 34 deletions
File tree
- scenes
- game_elements
- characters/enemies/throwing_enemy/components
- props
- player_follower
- spawn_point/components
- globals/pause
- quests
- story_quests
- champ
- 0_intro
- 4_outro
- el_abrigo
- 0_el_abrigo_intro
- 4_el_abrigo_outro
- el_juguete_perdido
- 0_intro
- 4_outro
- el_ojo_revelador
- 0_intro
- 4_outro
- eldrune
- 0_intro
- 4_outro
- renya_beyond_sorrow
- 0_intro
- 4_outro
- shjourney
- 2_shjourney_intro
- 6_Espada
- 9_shjourney_outro_2
- stella
- 0_stella_intro
- 4_stella_outro
- verso
- 0_verso_intro
- 4_verso_outro
- template_quests/NO_EDIT
- 0_NO_EDIT_intro
- 4_NO_EDIT_outro
- ui_elements
- dialogue/components
- input_hints/components
- world_map/components
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
175 | | - | |
| 175 | + | |
| 176 | + | |
176 | 177 | | |
177 | | - | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
264 | | - | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | 273 | | |
275 | 274 | | |
276 | 275 | | |
277 | 276 | | |
278 | | - | |
| 277 | + | |
279 | 278 | | |
280 | 279 | | |
281 | 280 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
0 commit comments