Skip to content

Conversation

@wjt
Copy link
Member

@wjt wjt commented Nov 28, 2025

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.

@github-actions
Copy link

Play this branch at https://endlessm.github.io/moddable-platformer/branches/endlessm/push-nstwurnuppst.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@wjt wjt force-pushed the push-nstwurnuppst branch from 7b3a687 to 646643e Compare November 28, 2025 17:28
wjt added 2 commits November 28, 2025 22:56
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.
The bug this was taking advantage of was fixed in Godot 4.4. The
property is displayed with a spin control despite this hack.

Godot 4.6 will add a new "prefer_slider" hint
<https://github.com/godotengine/godot/pull/1104599>.

Remove the weird 0.9-coin step, and replace the HACK comment with a TODO
for when we update to Godot 4.6.
@wjt wjt force-pushed the push-nstwurnuppst branch from 646643e to 97d1a24 Compare November 28, 2025 22:56
@wjt wjt marked this pull request as ready for review November 28, 2025 23:03
@wjt wjt requested a review from a team as a code owner November 28, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants