Skip to content

First3dGame - Change randi_range to randf_range to match source, use explicit floats for min and max speed#12075

Merged
mhilbrunner merged 2 commits into
godotengine:masterfrom
samw-26:patch-1
Jun 29, 2026
Merged

First3dGame - Change randi_range to randf_range to match source, use explicit floats for min and max speed#12075
mhilbrunner merged 2 commits into
godotengine:masterfrom
samw-26:patch-1

Conversation

@samw-26

@samw-26 samw-26 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Issue #9770
The docs used randi_range and integers for random_speed which does not match the source in https://github.com/godotengine/godot-demo-projects/tree/master/3d/squash_the_creeps and would cause an integer division bug when scaling the animation speed.

Additionally, min and max speed have been changed to floats for clarity. godotengine/godot-demo-projects#1329

@samw-26 samw-26 requested a review from a team as a code owner June 19, 2026 03:02
@skyace65

Copy link
Copy Markdown
Member

I have not reviewed the code. Please open a corresponding PR in the godot demo projects repository here: https://github.com/godotengine/godot-demo-projects/tree/master/3d/squash_the_creeps

@skyace65 skyace65 added needs work Needs additional work by the original author, someone else or in another repo area:getting started Issues and PRs related to the Getting Started section of the documentation labels Jun 20, 2026
@samw-26 samw-26 marked this pull request as draft June 21, 2026 01:54
The docs used randi_range instead of randf_range for the mob's
random_speed which did not match the source and would cause a bug with
integer division when using it to scale the animation speed.
@samw-26 samw-26 changed the title First3dGame - Adding Animations: Fix integer division bug First3dGame - Change randi_range to randf_range to match source Jun 21, 2026
@samw-26 samw-26 changed the title First3dGame - Change randi_range to randf_range to match source First3dGame - Change randi_range to randf_range to match source, use explicit floats for min and max speed Jun 21, 2026
@samw-26 samw-26 marked this pull request as ready for review June 21, 2026 02:32
Comment thread getting_started/first_3d_game/04.mob_scene.rst Outdated
Comment thread getting_started/first_3d_game/04.mob_scene.rst Outdated

@aaronfranke aaronfranke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Should be merged in parallel with the demos PR, I'll let people review here first before merging there.

@skyace65 skyace65 removed the needs work Needs additional work by the original author, someone else or in another repo label Jun 21, 2026
@samw-26

samw-26 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!

@Calinou Calinou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@mhilbrunner mhilbrunner merged commit 3b193c7 into godotengine:master Jun 29, 2026
1 check passed
@mhilbrunner

Copy link
Copy Markdown
Member

Thank you! And thanks for the reviews everyone. Merged.

@samw-26 samw-26 deleted the patch-1 branch July 9, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:getting started Issues and PRs related to the Getting Started section of the documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants