Commit 3db100e
committed
Find coin nodes by their group
Previously, game_logic.gd walked recursively over all nodes in the tree,
counting those which are an instance of the Coin script.
A more idiomatic way to do this is to place coins into a group, and then
count how many nodes are in that group. This will also make it easier to
have some coins that don't count towards the goal, by having those coins
not be in this group.1 parent 6ec78a9 commit 3db100e
File tree
3 files changed
+3
-11
lines changed- components/coin
- scripts/rules_goals
3 files changed
+3
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 47 | | |
55 | 48 | | |
56 | 49 | | |
| |||
65 | 58 | | |
66 | 59 | | |
67 | 60 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 61 | + | |
71 | 62 | | |
72 | 63 | | |
73 | 64 | | |
| |||
0 commit comments